Browse Source

adc_common_v2: bugfix ADC_xT1_VAL(x)

mask out bits that must not be written
pull/1167/head
Jacob Walser 5 years ago
committed by Karl Palsson
parent
commit
5409ce73bd
  1. 4
      include/libopencm3/stm32/common/adc_common_v2.h

4
include/libopencm3/stm32/common/adc_common_v2.h

@ -190,13 +190,13 @@ specific memorymap.h header before including this header file.*/
#define ADC_TR1_LT_MASK 0xFFF
#define ADC_TR1_LT (0xFFF << ADC_TR1_LT_SHIFT)
/** TR1_LT: analog watchdog 1 threshold low */
#define ADC_TR1_LT_VAL(x) ((x) << ADC_TR1_LT_SHIFT)
#define ADC_TR1_LT_VAL(x) (((x) & ADC_TR1_LT_MASK) << ADC_TR1_LT_SHIFT)
#define ADC_TR1_HT_SHIFT 16
#define ADC_TR1_HT_MASK 0xFFF
#define ADC_TR1_HT (0xFFF << ADC_TR1_HT_SHIFT)
/** TR1_HT: analog watchdog 1 threshold high */
#define ADC_TR1_HT_VAL(x) ((x) << ADC_TR1_HT_SHIFT)
#define ADC_TR1_HT_VAL(x) (((x) & ADC_TR1_HT_MASK) << ADC_TR1_HT_SHIFT)
/**@}*/

Loading…
Cancel
Save