EXTI interrupt abstraction feature complete

This commit is contained in:
2025-09-08 02:24:02 -07:00
parent a02ec044ce
commit a599aa5a4e
6 changed files with 20 additions and 32 deletions

View File

@@ -22,11 +22,11 @@ extern "C" void EXTI##EXTI_Channel##_IRQHandler(void) { \
};
#define DEFINE_MULTI_EXTI_IRQ(EXTI_Channel_Min, EXTI_Channel_Max) \
extern "C" void EXTI##EXTI_Channel_Max##_##EXTI_Channel_Min##_IRQHandler(void) { \
extern "C" void EXTI##EXTI_Channel_Min##_##EXTI_Channel_Max##_IRQHandler(void) { \
for(uint8_t line = EXTI_Channel_Min; line <= EXTI_Channel_Max; line++){ \
if (EXTI->PR & (1 << line)) { \
EXTI->PR |= (1 << line); /*clear flag */ \
auto cb = EXTI_callbacks[line]; \
auto cb = EXTI_callbacks[line]; \
if (cb) cb(); \
}; \
} \

View File

@@ -209,7 +209,7 @@ constexpr SHAL_Peripheral_Register getGPIORCCEnable(const GPIO_Key g){
__builtin_unreachable();
}
constexpr unsigned int getGPIOPortNumber(const GPIO_Key g){
constexpr uint32_t getGPIOPortNumber(const GPIO_Key g){
switch(g) {
case GPIO_Key::A0:
case GPIO_Key::A1:

View File

@@ -17,13 +17,13 @@ class UART{
public:
//begins Tx and Usart TODO either modify this function or add a new one that supports Rx
void begin(uint32_t baudRate);
void begin(uint32_t baudRate) volatile;
//Sends a string
void sendString(const char* s);
void sendString(const char* s) volatile;
//Sends a char
void sendChar(char c);
void sendChar(char c) volatile;
private: