Skip to content

Commit

Permalink
Merge pull request #228 from tonybaltovski/fix/stl-overflow-define
Browse files Browse the repository at this point in the history
Updated define for AdcInterruptFeature to avoid conflict with math.h …
  • Loading branch information
andysworkshop authored Feb 23, 2021
2 parents 476aba6 + 712f68a commit 0c183ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions lib/include/adc/features/f0/AdcInterruptFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace stm32plus {
public:
enum {
END_OF_CONVERSION = 0x01,
OVERFLOW = 0x02,
ADC_OVERFLOW = 0x02,
END_OF_SEQUENCE = 0x04,
ANALOG_WATCHDOG = 0x08,
END_OF_SAMPLING = 0x10,
Expand Down Expand Up @@ -93,7 +93,7 @@ namespace stm32plus {

/**
* Enable the interrupts specified in the mask
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | OVERFLOW
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | ADC_OVERFLOW
*/

inline void AdcInterruptFeature::enableInterrupts(uint16_t interruptMask) {
Expand All @@ -114,7 +114,7 @@ namespace stm32plus {
ADC_ITConfig(_adc,ADC_IT_EOSMP,ENABLE);
if((interruptMask & ANALOG_WATCHDOG)!=0)
ADC_ITConfig(_adc,ADC_IT_AWD,ENABLE);
if((interruptMask & OVERFLOW)!=0)
if((interruptMask & ADC_OVERFLOW)!=0)
ADC_ITConfig(_adc,ADC_IT_OVR,ENABLE);
if((interruptMask & ADC_READY)!=0)
ADC_ITConfig(_adc,ADC_IT_ADRDY,ENABLE);
Expand All @@ -123,7 +123,7 @@ namespace stm32plus {

/**
* Disable the interrupts specified in the mask
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | OVERFLOW
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | ADC_OVERFLOW
*/

inline void AdcInterruptFeature::disableInterrupts(uint16_t interruptMask) {
Expand All @@ -137,7 +137,7 @@ namespace stm32plus {
ADC_ITConfig(_adc,ADC_IT_EOSMP,DISABLE);
if((interruptMask & ANALOG_WATCHDOG)!=0)
ADC_ITConfig(_adc,ADC_IT_AWD,DISABLE);
if((interruptMask & OVERFLOW)!=0)
if((interruptMask & ADC_OVERFLOW)!=0)
ADC_ITConfig(_adc,ADC_IT_OVR,DISABLE);
if((interruptMask & ADC_READY)!=0)
ADC_ITConfig(_adc,ADC_IT_ADRDY,DISABLE);
Expand Down
4 changes: 2 additions & 2 deletions lib/include/adc/features/f1/AdcInterruptFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace stm32plus {

/**
* Enable the interrupts specified in the mask
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | OVERFLOW
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | ADC_OVERFLOW
*/

inline void AdcInterruptFeature::enableInterrupts(uint16_t interruptMask) {
Expand All @@ -122,7 +122,7 @@ namespace stm32plus {

/**
* Disable the interrupts specified in the mask
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | OVERFLOW
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | ADC_OVERFLOW
*/

inline void AdcInterruptFeature::disableInterrupts(uint16_t interruptMask) {
Expand Down
10 changes: 5 additions & 5 deletions lib/include/adc/features/f4/AdcInterruptFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace stm32plus {
enum {
END_OF_CONVERSION = 0x01,
INJECTED_END_OF_CONVERSION = 0x02,
OVERFLOW = 0x04,
ADC_OVERFLOW = 0x04,
ANALOG_WATCHDOG = 0x08
};

Expand Down Expand Up @@ -95,7 +95,7 @@ namespace stm32plus {

/**
* Enable the interrupts specified in the mask
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | OVERFLOW
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | ADC_OVERFLOW
*/

inline void AdcInterruptFeature::enableInterrupts(uint16_t interruptMask) {
Expand All @@ -111,14 +111,14 @@ namespace stm32plus {
ADC_ITConfig(_adc,ADC_IT_JEOC,ENABLE);
if((interruptMask & ANALOG_WATCHDOG)!=0)
ADC_ITConfig(_adc,ADC_IT_AWD,ENABLE);
if((interruptMask & OVERFLOW)!=0)
if((interruptMask & ADC_OVERFLOW)!=0)
ADC_ITConfig(_adc,ADC_IT_OVR,ENABLE);
}


/**
* Disable the interrupts specified in the mask
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | OVERFLOW
* @param interruptMask The bitmask of interrupts, e.g. END_OF_CONVERSION | ADC_OVERFLOW
*/

inline void AdcInterruptFeature::disableInterrupts(uint16_t interruptMask) {
Expand All @@ -130,7 +130,7 @@ namespace stm32plus {
ADC_ITConfig(_adc,ADC_IT_JEOC,DISABLE);
if((interruptMask & ANALOG_WATCHDOG)!=0)
ADC_ITConfig(_adc,ADC_IT_AWD,DISABLE);
if((interruptMask & OVERFLOW)!=0)
if((interruptMask & ADC_OVERFLOW)!=0)
ADC_ITConfig(_adc,ADC_IT_OVR,DISABLE);
}
}

0 comments on commit 0c183ac

Please sign in to comment.