Created structs and enums for alternate function UART pins
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user