-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mqtt dashboard compatibility with hal.h functions #2516
Conversation
@@ -12,7 +12,7 @@ static struct mg_rpc *s_rpc_head = NULL; | |||
|
|||
struct device_config { | |||
bool led_status; | |||
uint8_t led_pin; | |||
uint16_t led_pin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hal "pin" in uint16_t
if (tmp_pin >= 0) s_device_config.led_pin = tmp_pin; | ||
|
||
if (tmp_pin > 0 && ok) { | ||
if (tmp_pin >= 0 && ok) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"0" is a valid pin number
@@ -238,6 +238,7 @@ void web_init(struct mg_mgr *mgr) { | |||
if (!g_device_id) generate_device_id(); | |||
if (!g_root_topic) g_root_topic = DEFAULT_ROOT_TOPIC; | |||
s_device_config.log_level = (uint8_t) mg_log_level; | |||
s_device_config.led_pin = LED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default to LED pin in real hw
@@ -27,7 +27,6 @@ pico_enable_stdio_uart(firmware 1) # to the UART | |||
add_definitions(-DMG_ENABLE_TCPIP=1) | |||
add_definitions(-DMG_ENABLE_PACKED_FS=1) | |||
add_definitions(-DMG_ENABLE_FILE=0) | |||
add_definitions(-DDISABLE_ROUTING=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old leftover
static bool s_pins[100]; | ||
|
||
void gpio_write(int pin, bool status) { | ||
if (pin >= 0 && pin <= (int) (sizeof(s_pins) / sizeof(s_pins[0]))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"=" was actually out of bounds
No description provided.