Skip to content

Commit

Permalink
Set sensor mode if sensor is already setup
Browse files Browse the repository at this point in the history
This helps when updating a module
  • Loading branch information
MaartenS11 committed Oct 28, 2024
1 parent 9fc795f commit 6faffce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Primitives/zephyr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,13 @@ def_prim(setup_uart_sensor, twoToNoneU32) {
return 0;
}
uart_irq_rx_enable(uart_dev);
mode = arg0.uint32;
uint8_t new_mode = arg0.uint32;
if (new_mode != mode && data_mode) {
uart_poll_out(uart_dev, 0x43);
uart_poll_out(uart_dev, new_mode);
uart_poll_out(uart_dev, 0xff ^ 0x43 ^ new_mode);
}
mode = new_mode;
pop_args(2);
return true;
}
Expand Down

0 comments on commit 6faffce

Please sign in to comment.