3030
3131#include "../sys/storage.h"
3232
33- #define PBDRV_CONFIG_ADC_EV3_NUM_DELAY_SAMPLES (2)
33+ #define PBDRV_ADC_EV3_NUM_DELAY_SAMPLES (2)
3434
3535/**
3636 * Constants.
6161 (((x) & 0xf) << 7) | \
6262 (1 << 6)
6363
64- static const uint32_t channel_cmd [PBDRV_CONFIG_ADC_EV3_ADC_NUM_CHANNELS + PBDRV_CONFIG_ADC_EV3_NUM_DELAY_SAMPLES ] = {
64+ static const uint32_t channel_cmd [PBDRV_CONFIG_ADC_EV3_ADC_NUM_CHANNELS + PBDRV_ADC_EV3_NUM_DELAY_SAMPLES ] = {
6565 MANUAL_ADC_CHANNEL (0 ),
6666 MANUAL_ADC_CHANNEL (1 ),
6767 MANUAL_ADC_CHANNEL (2 ),
@@ -88,7 +88,7 @@ static const uint32_t channel_cmd[PBDRV_CONFIG_ADC_EV3_ADC_NUM_CHANNELS + PBDRV_
8888 MANUAL_ADC_CHANNEL (15 ),
8989 MANUAL_ADC_CHANNEL (15 ),
9090};
91- static volatile uint16_t channel_data [PBDRV_CONFIG_ADC_EV3_ADC_NUM_CHANNELS + PBDRV_CONFIG_ADC_EV3_NUM_DELAY_SAMPLES ];
91+ static volatile uint16_t channel_data [PBDRV_CONFIG_ADC_EV3_ADC_NUM_CHANNELS + PBDRV_ADC_EV3_NUM_DELAY_SAMPLES ];
9292
9393static int adc_soon ;
9494// Used to block ADC from interfering with flash upon shutdown
@@ -113,8 +113,8 @@ pbio_error_t pbdrv_adc_get_ch(uint8_t ch, uint16_t *value) {
113113 uint16_t a , b ;
114114 do {
115115 // Values for the requested channel are received several samples later.
116- a = channel_data [ch + PBDRV_CONFIG_ADC_EV3_NUM_DELAY_SAMPLES ];
117- b = channel_data [ch + PBDRV_CONFIG_ADC_EV3_NUM_DELAY_SAMPLES ];
116+ a = channel_data [ch + PBDRV_ADC_EV3_NUM_DELAY_SAMPLES ];
117+ b = channel_data [ch + PBDRV_ADC_EV3_NUM_DELAY_SAMPLES ];
118118 } while (a != b );
119119
120120 // Mask the data to 10 bits
@@ -157,7 +157,7 @@ pbio_error_t pbdrv_adc_ev3_process_thread(pbio_os_state_t *state, void *context)
157157 pbdrv_block_device_ev3_spi_begin_for_adc (
158158 channel_cmd ,
159159 channel_data ,
160- PBDRV_CONFIG_ADC_EV3_ADC_NUM_CHANNELS + PBDRV_CONFIG_ADC_EV3_NUM_DELAY_SAMPLES );
160+ PBDRV_CONFIG_ADC_EV3_ADC_NUM_CHANNELS + PBDRV_ADC_EV3_NUM_DELAY_SAMPLES );
161161 PBIO_OS_AWAIT_WHILE (state , pbdrv_block_device_ev3_is_busy ());
162162
163163 for (uint32_t i = 0 ; i < pbdrv_adc_callback_count ; i ++ ) {
0 commit comments