State Estimations & Telemetry Updates - #65
Conversation
butchhartman
left a comment
There was a problem hiding this comment.
Only real CR is to put duplicated serial port code from emulator_uart.c into helper functions.
| } TELEM_STATE; | ||
|
|
||
| static TELEM_STATE state_buf[8] = { | ||
| [0 ... 7] = { .timestamp_available = 0xFFFFFFFF } /* GNU ONLY */ |
There was a problem hiding this comment.
this is some evil syntax dude 😭
There was a problem hiding this comment.
would rather do this than have an initialization function, although ig i could do it on serial port init. either way we've committed to the GNU ecosystem so i'm gonna leave it doing this at initialization time :)
| /* Prompt for serial port */ | ||
| char port_buf[12]; | ||
| emulator_log("Please enter your serial port in the format /dev/ttyXX or in the format COMX.", EMULATOR_SUBSYSTEM_GS); | ||
| #if defined( _WIN32 ) || defined( __CYGWIN__ ) |
There was a problem hiding this comment.
Remove empty conddef block
| // ETS: THIS IS GROSS. Do not do this. | ||
| #pragma GCC diagnostic push | ||
| #pragma GCC diagnostic ignored "-Wformat-truncation" | ||
| snprintf(port_buf, 12, "/dev/ttyS%u", last_two_digits); |
| @@ -0,0 +1,529 @@ | |||
| /** | |||
There was a problem hiding this comment.
Only complaint here is magic numbers but If I recall that's a problem with lora in general so probably fine to ignore until that's changed in the firmware
There was a problem hiding this comment.
The serial port code looks like its the exact same as in emulator_uart.c. I would recommend separating the code for opening, reading, and writing a serial port to helper functions in a file like emulator_serial.c or something.
| return false; | ||
| } | ||
|
|
||
| port_buf[strcspn(port_buf, "\n")] = 0; |
There was a problem hiding this comment.
Probably best for this to be a '\0' for clarity.
|
only one unaddressed is the LoRa thing bc you're 100% right lmao. rereview ready |
butchhartman
left a comment
There was a problem hiding this comment.
meowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeow
Support for the state estimations epic as well as a basic ground station emulator implementation.
Closes: #56
Parent: SunDevilRocketry/Flight-Computer-Firmware#301