-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61e3008
commit dd378a7
Showing
6 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include "logs_output.h" | ||
#include "esp_log.h" | ||
#include "general_radio_selection.h" | ||
#include "menus_module.h" | ||
#include "preferences.h" | ||
#include "uart_bridge.h" | ||
|
||
static char* logs_output_options[] = { | ||
"USB", | ||
"UART TXD/RXD", | ||
}; | ||
|
||
// Same order as logs_output_options | ||
typedef enum { | ||
USB, | ||
UART, | ||
} logs_output_option_t; | ||
|
||
uint8_t logs_output_get_option() { | ||
return preferences_get_uchar("logs_output", USB); | ||
} | ||
|
||
void logs_output_set_logs_output(logs_output_option_t selected_option) { | ||
switch (selected_option) { | ||
case USB: | ||
uart_bridge_set_logs_to_usb(); | ||
preferences_put_uchar("logs_output", USB); | ||
break; | ||
case UART: | ||
uart_bridge_set_logs_to_uart(); | ||
preferences_put_uchar("logs_output", UART); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
void logs_output() { | ||
general_radio_selection_menu_t logs_output_menu = { | ||
.options = logs_output_options, | ||
.banner = "Logs Output", | ||
.current_option = logs_output_get_option(), | ||
.options_count = sizeof(logs_output_options) / sizeof(char*), | ||
.select_cb = logs_output_set_logs_output, | ||
.exit_cb = menus_module_exit_app, | ||
.style = RADIO_SELECTION_OLD_STYLE, | ||
}; | ||
|
||
general_radio_selection(logs_output_menu); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
|
||
void logs_output(); |