diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-09-26 09:49:12 +0200 |
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-09-26 09:49:12 +0200 |
| commit | b7f74a89a65933ec98d72fdaa5a02a6932ef9e39 (patch) | |
| tree | bb598791e5073d940e63076bdde61ac54ef71a7b /src/common | |
| parent | b634ee618288e217a2d26fcd04acbc63df520523 (diff) | |
| download | glutte-o-matic-b7f74a89a65933ec98d72fdaa5a02a6932ef9e39.tar.gz glutte-o-matic-b7f74a89a65933ec98d72fdaa5a02a6932ef9e39.tar.bz2 glutte-o-matic-b7f74a89a65933ec98d72fdaa5a02a6932ef9e39.zip | |
Add delays to fix aggressive FAULT_ADC1
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/includes/GPIO/analog.h | 6 | ||||
| -rw-r--r-- | src/common/src/Core/common.c | 2 | ||||
| -rw-r--r-- | src/common/src/GPIO/usart.c | 13 |
3 files changed, 9 insertions, 12 deletions
diff --git a/src/common/includes/GPIO/analog.h b/src/common/includes/GPIO/analog.h index 375708f..ddc19ac 100644 --- a/src/common/includes/GPIO/analog.h +++ b/src/common/includes/GPIO/analog.h @@ -29,16 +29,22 @@ void analog_init(void); /* Measure the 12V supply voltage, in 0.5V increments. * Returns 0.0f in case of error + * + * Warning, do not run from interrupt context! */ float analog_measure_12v(void); /* Measure SWR, and return voltages in mV. * Returns 0 in case of error, 1 in case of success + * + * Warning, do not run from interrupt context! */ int analog_measure_swr(int *forward_mv, int* reflected_mv); /* Keep an average of measurements, and decide if the repeater should enter * QRP. Returns 1 if low power must be activated + * + * Warning, do not run from interrupt context! */ int analog_supply_too_low(void); diff --git a/src/common/src/Core/common.c b/src/common/src/Core/common.c index 2790f15..9c7d3c5 100644 --- a/src/common/src/Core/common.c +++ b/src/common/src/Core/common.c @@ -253,7 +253,7 @@ int random_bool(void) static int faultsource = 0; void trigger_fault(int source) { - usart_debug("Fatal: %d", source); + usart_debug("Fatal: %d\r\n\r\n", source); __disable_irq(); diff --git a/src/common/src/GPIO/usart.c b/src/common/src/GPIO/usart.c index ee7ad9f..052c546 100644 --- a/src/common/src/GPIO/usart.c +++ b/src/common/src/GPIO/usart.c @@ -127,17 +127,8 @@ static void usart_clear_nmea_buffer(void) { } void usart_process_char(char c) { - - if (c == 'h') { - usart_debug_puts("help: commands: [v]oltage.\r\n"); - } - else if (c == 'v') { - const float supply_voltage = analog_measure_12v(); - usart_debug("12V monitor %dmV\r\n", (int32_t)(supply_voltage * 1000.0f)); - } - else { - usart_debug("Unknown command %c\r\n", c); - } +// Warning: running in interrupt context + usart_debug("Unknown command %c\r\n", c); } void usart_gps_process_char(char c) { |
