diff --git a/rx_esp32/src/commands.c b/rx_esp32/src/commands.c index 2c56381..22a1a16 100644 --- a/rx_esp32/src/commands.c +++ b/rx_esp32/src/commands.c @@ -158,11 +158,14 @@ int cmd_clearlog(char* line, void* cli) } const CMD_t Commands[] = { - { "history", &cmd_history }, +#if TARGET == TARGET_RX { "d", &cmd_contrl }, - { "shutdown", &cmd_shutdown }, { "status", &cmd_status }, +#elif TARGET == TARGET_TX { "led", &setLed }, +#endif + { "history", &cmd_history }, + { "shutdown", &cmd_shutdown }, { "log", &cmd_showlog }, { "logclear", &cmd_clearlog } }; diff --git a/rx_esp32/src/main.c b/rx_esp32/src/main.c index 14515ce..fdd976d 100644 --- a/rx_esp32/src/main.c +++ b/rx_esp32/src/main.c @@ -14,12 +14,13 @@ #include "utils.h" #include "commands.h" #include "wifi.h" -#include "servos.h" #include "logger.h" #include "ws.h" #if TARGET == TARGET_TX #include "led.h" #include "adc.h" +#elif TARGET == TARGET_RX +#include "servos.h" #endif bool volatile running = true; @@ -70,28 +71,6 @@ int charOut_ws(const char* c) ws_putchar(ws_client, *c); return 0; } -#elif TARGET == TARGET_TX -int charOut_ws0(const char* c) -{ - ws_putchar(ws_client[0], *c); - return 0; -} -int charOut_ws1(const char* c) -{ - ws_putchar(ws_client[1], *c); - return 0; -} -int charOut_ws2(const char* c) -{ - ws_putchar(ws_client[2], *c); - return 0; -} - -CLI_charOutFn charOut_ws[3] = { - &charOut_ws0, - &charOut_ws1, - &charOut_ws2 -}; #endif void app_main() { @@ -112,8 +91,9 @@ void app_main() { #if TARGET == TARGET_TX led_init(); led_setRGB(0, 0, 20); -#endif +#elif TARGET == TARGET_RX servo_init(); +#endif wifiInit(); bool adc_inited = false; diff --git a/tx_case/tx_case.FCStd b/tx_case/tx_case.FCStd new file mode 100644 index 0000000..b525f86 Binary files /dev/null and b/tx_case/tx_case.FCStd differ