Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

robertc2000
Copy link
Collaborator

No description provided.

@@ -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;
Copy link
Collaborator

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

Comment on lines +114 to +116
if (tmp_pin >= 0) s_device_config.led_pin = tmp_pin;

if (tmp_pin > 0 && ok) {
if (tmp_pin >= 0 && ok) {
Copy link
Collaborator

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;
Copy link
Collaborator

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)
Copy link
Collaborator

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]))) {
Copy link
Collaborator

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

@scaprile scaprile closed this Dec 8, 2023
@scaprile scaprile deleted the mqtt-2 branch December 21, 2023 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants