Fixed improper _

This commit is contained in:
Kevin Thomas
2026-04-11 10:52:10 -04:00
parent f6683beff5
commit 0df58712e1
70 changed files with 603 additions and 603 deletions
+2 -2
View File
@@ -53,7 +53,7 @@
* Samples the ADC channel for voltage in millivolts and reads the
* on-chip temperature sensor, then prints both values.
*/
static void _print_adc_readings(void) {
static void print_adc_readings(void) {
uint32_t voltage_mv = adc_driver_read_mv();
float temp_c = adc_driver_read_temp_celsius();
printf("ADC0: %4lu mV | Chip temp: %.1f C\r\n", voltage_mv, temp_c);
@@ -64,7 +64,7 @@ int main(void) {
adc_driver_init(ADC_GPIO, ADC_CHANNEL);
printf("ADC driver initialized: GPIO%d (channel %d)\r\n", ADC_GPIO, ADC_CHANNEL);
while (true) {
_print_adc_readings();
print_adc_readings();
sleep_ms(500);
}
}
+4 -4
View File
@@ -47,7 +47,7 @@ static uint8_t active_channel = 0;
* @param raw 12-bit ADC conversion result (0 - 4095)
* @return uint32_t Equivalent voltage in millivolts (0 - 3300)
*/
static uint32_t _raw_to_mv(uint16_t raw) {
static uint32_t raw_to_mv(uint16_t raw) {
return (uint32_t)raw * ADC_VREF_MV / ADC_FULL_SCALE;
}
@@ -60,7 +60,7 @@ static uint32_t _raw_to_mv(uint16_t raw) {
* @param raw 12-bit ADC result from the internal temperature sensor (channel 4)
* @return float Die temperature in degrees Celsius
*/
static float _raw_to_celsius(uint16_t raw) {
static float raw_to_celsius(uint16_t raw) {
float voltage = (float)raw * 3.3f / (float)ADC_FULL_SCALE;
return 27.0f - (voltage - 0.706f) / 0.001721f;
}
@@ -74,12 +74,12 @@ void adc_driver_init(uint32_t gpio, uint8_t channel) {
}
uint32_t adc_driver_read_mv(void) {
return _raw_to_mv(adc_read());
return raw_to_mv(adc_read());
}
float adc_driver_read_temp_celsius(void) {
adc_select_input(4);
float result = _raw_to_celsius(adc_read());
float result = raw_to_celsius(adc_read());
adc_select_input(active_channel);
return result;
}