commit 1bece87f65dba85e9358d4e4600875bc150aa1b1
parent 2c8312da0ad20e87036079ce602a5fe954d3c727
Author: Lukas F. Hartmann <lukas@mntre.com>
Date: Wed, 22 Dec 2021 12:49:27 +0100
kbd: remote: don't try remote commands if we're standalone
Diffstat:
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/reform2-keyboard-fw/remote.c b/reform2-keyboard-fw/remote.c
@@ -76,6 +76,11 @@ int remote_try_wakeup(void) {
int ok = 0;
char buf[64];
+#ifdef KBD_VARIANT_STANDALONE
+ // there's no remote
+ return 0;
+#endif
+
for (int i=0; i<1000; i++) {
if (i%10 == 0) {
gfx_clear();
@@ -107,6 +112,11 @@ int remote_try_wakeup(void) {
int remote_try_command(char* cmd, int print_response) {
int ok = 0;
+#ifdef KBD_VARIANT_STANDALONE
+ // there's no remote
+ return 0;
+#endif
+
empty_serial();
for (int tries=0; tries<2; tries++) {
for (int i=0; i<strlen(cmd); i++) {
@@ -282,7 +292,7 @@ int remote_check_for_low_battery(void) {
remote_som_power_expected_state = is_computer_on;
}
}
-
+
return ok;
}
@@ -310,7 +320,7 @@ int remote_turn_on_som(void) {
// FIXME what is remote_som_power_expected_state?
return ok;
}
-
+
remote_som_power_expected_state = 1;
return ok;
}