jlab-sensing / soil-power-sensor-firmware

Firmware for STM32 and ESP32 microcontrollers on the Soil Power Sensor board
MIT License
0 stars 3 forks source link

Fix main code hanging #86

Closed jmadden173 closed 1 month ago

jmadden173 commented 1 month ago

Name/Affiliation/Title John, maintainer

Purpose of the PR Get our main firmware running

Development Environment Linux spruce 6.8.2-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 28 Mar 2024 17:06:35 +0000 x86_64 GNU/Linux PlatformIO Core, version 6.1.7 Used ST-Link V3 MINIE

Test Procedure Flash the [env:stm32] environment on the board

pio run -t upload -t monitor

Additional Context I think the main issue causing the hang was ADC initialization code in adc_if.c. Looks like it got rewrote at some point by CubeMX. I also fixed duplicate include guards between sys_sensors.h and sensors.h and increased the measurement frequency. The time sync code was also rewritten to be inside of SendTxData so that all LmHandlerSend is included within that function call.

Closes #85