diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-26 15:44:26 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-26 15:44:26 +0200 |
commit | ee5d161f6153e1f9da73e477f63f38dcf52ca10c (patch) | |
tree | 926413950f64ed7b0f45f6b3551c16446ecd08d4 /lib/pbdrv/drv/arduino | |
parent | c77d271d9cb86bf6893098ec6c431fc87945e6c9 (diff) |
`make format`
Diffstat (limited to 'lib/pbdrv/drv/arduino')
-rw-r--r-- | lib/pbdrv/drv/arduino/mod.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/pbdrv/drv/arduino/mod.cpp b/lib/pbdrv/drv/arduino/mod.cpp index 27237d2..500edfa 100644 --- a/lib/pbdrv/drv/arduino/mod.cpp +++ b/lib/pbdrv/drv/arduino/mod.cpp @@ -3,14 +3,14 @@ #include <avr/delay.h> #include <FreeRTOS.h> -#include <timers.h> #include <task.h> +#include <timers.h> -#include "../../pb.h" -#include "../../pb-mod.h" -#include "../../pb-types.h" #include "../../pb-buf.h" #include "../../pb-mem.h" +#include "../../pb-mod.h" +#include "../../pb-types.h" +#include "../../pb.h" static void async_pb_i2c_recv(void * _msg, uint32_t _) { pb_buf_t * msg = (pb_buf_t *) _msg; @@ -23,8 +23,7 @@ static void recv_event(int bytes) { pb_buf_t * msg = (pb_buf_t *) pb_malloc(sizeof(pb_buf_t)); msg->data = (char *) pb_malloc(bytes); msg->size = 0; - while (Wire.available()) - msg->data[msg->size++] = Wire.read(); + while (Wire.available()) msg->data[msg->size++] = Wire.read(); // defer pb_i2c_recv call xTimerPendFunctionCallFromISR(async_pb_i2c_recv, msg, 0, NULL); @@ -66,7 +65,7 @@ void init(void); //! FreeRTOS loop task void loop_task() { - for(;;) { + for (;;) { loop(); if (serialEventRun) serialEventRun(); } @@ -90,8 +89,8 @@ int main(void) { init(); // call arduino internal setup setup(); // call regular arduino setup pb_setup(); // call pbdrv-mod setup - xTaskCreate((TaskFunction_t) loop_task, "loop", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL); + xTaskCreate((TaskFunction_t) loop_task, "loop", configMINIMAL_STACK_SIZE, + NULL, tskIDLE_PRIORITY + 1, NULL); vTaskStartScheduler(); // start freertos scheduler return 0; } - |