summaryrefslogtreecommitdiff
path: root/firmware/s1224/src/common/modem_probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/s1224/src/common/modem_probe.c')
-rw-r--r--firmware/s1224/src/common/modem_probe.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/firmware/s1224/src/common/modem_probe.c b/firmware/s1224/src/common/modem_probe.c
new file mode 100644
index 0000000..9624d32
--- /dev/null
+++ b/firmware/s1224/src/common/modem_probe.c
@@ -0,0 +1,22 @@
+/*
+ * Softmodem health — no chip/crystal checks.
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+#include "modem_probe.h"
+#include "config.h"
+#include "afsk_soft.h"
+#include <stdio.h>
+
+modem_probe_result_t modem_probe_run(void)
+{
+ modem_probe_result_t r = {0};
+ r.softmodem_ok = true;
+ r.af_tx_pwm = true;
+ r.ready = r.softmodem_ok && (afsk_bitrate() == 300u || afsk_bitrate() == 1200u || afsk_bitrate() == 2400u);
+
+ if (config_unsolicited_ok()) {
+ printf("PROBE softmodem=%d bitrate=%u -> %s\r\n",
+ (int)r.softmodem_ok, afsk_bitrate(), r.ready ? "READY" : "FAULT");
+ }
+ return r;
+}
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com