General cleanup, use _BV

This commit is contained in:
Scott Lahteine
2021-01-16 19:03:06 -06:00
parent 69a6d26c80
commit b41f41589a
19 changed files with 56 additions and 81 deletions

View File

@ -31,7 +31,7 @@
*/
#ifndef MASK
#define MASK(PIN) (1 << PIN)
#define MASK(PIN) _BV(PIN)
#endif
/**

View File

@ -157,7 +157,7 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num) {
// missing from CMSIS: Check if interrupt is enabled or not
static bool NVIC_GetEnabledIRQ(IRQn_Type IRQn) {
return (NVIC->ISER[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) != 0;
return TEST(NVIC->ISER[uint32_t(IRQn) >> 5], uint32_t(IRQn) & 0x1F);
}
bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {