Created structs and enums for alternate function UART pins

This commit is contained in:
2025-09-06 19:49:36 -07:00
parent f6e21fbd88
commit d763965cb8
6 changed files with 81 additions and 10 deletions

View File

@@ -55,7 +55,7 @@ void GPIO::setHigh() {
static_cast<GPIO_TypeDef*>(gpioPeripheral.registers)->ODR |= (1 << gpioPeripheral.global_offset);
}
void GPIO::toggle() {
void GPIO::toggle() volatile {
auto gpioPeripheral = getGPIORegister(m_GPIO_KEY);
static_cast<GPIO_TypeDef*>(gpioPeripheral.registers)->ODR ^= (1 << gpioPeripheral.global_offset);
}

View File

@@ -2,8 +2,8 @@
#include "stm32f0xx.h"
GPIO* blueLED = nullptr;
GPIO* greenLED = nullptr;
volatile GPIO* blueLED = nullptr;
volatile GPIO* greenLED = nullptr;
extern "C" void EXTI0_1_IRQHandler(void) {
if (EXTI->PR & (1 << 0)) { //Check pending flag