diff options
Diffstat (limited to 'drivers/ginput/touch')
-rw-r--r-- | drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h index cde1ba77..84f3416c 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h @@ -106,7 +106,7 @@ static __inline void release_bus(void) { * @notapi
*/
static __inline uint16_t read_x_value(void) {
- uint16_t val1, val2;
+ uint16_t val1, val2;
adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_ANALOG);
@@ -114,13 +114,13 @@ static __inline uint16_t read_x_value(void) { palSetPadMode(GPIOC, 2, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOC, 3, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPad(GPIOC, 2);
+ palSetPad(GPIOC, 2);
palClearPad(GPIOC, 3);
chThdSleepMilliseconds(1);
adcConvert(&ADCD1, &adc_x_config, samples, ADC_BUF_DEPTH);
val1 = ((samples[0] + samples[1])/2);
-
- palClearPad(GPIOC, 2);
+
+ palClearPad(GPIOC, 2);
palSetPad(GPIOC, 3);
chThdSleepMilliseconds(1);
adcConvert(&ADCD1, &adc_x_config, samples, ADC_BUF_DEPTH);
@@ -136,22 +136,22 @@ static __inline uint16_t read_x_value(void) { * @notapi
*/
static __inline uint16_t read_y_value(void) {
- uint16_t val1, val2;
+ uint16_t val1, val2;
adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
palSetPadMode(GPIOC, 2, PAL_MODE_INPUT_ANALOG);
palSetPadMode(GPIOC, 3, PAL_MODE_INPUT_ANALOG);
palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOC, 1, PAL_MODE_OUTPUT_PUSHPULL);
-
+ return 42;
palSetPad(GPIOC, 1);
palClearPad(GPIOC, 0);
chThdSleepMilliseconds(1);
adcConvert(&ADCD1, &adc_y_config, samples, ADC_BUF_DEPTH);
val1 = ((samples[0] + samples[1])/2);
- palClearPad(GPIOC, 0);
- palSetPad(GPIOC, 1);
+ palClearPad(GPIOC, 1);
+ palSetPad(GPIOC, 0);
chThdSleepMilliseconds(1);
adcConvert(&ADCD1, &adc_y_config, samples, ADC_BUF_DEPTH);
val2 = ((samples[0] + samples[1])/2);
|