Cleanup and finish build system

This commit is contained in:
2025-08-27 23:06:57 -07:00
parent 385d6c3728
commit 1598e13a5a
8 changed files with 56 additions and 307 deletions

View File

@@ -1,5 +1,5 @@
#include "SHAL.h"
#include "stm32f0xx.h" // Or your device header
#include "stm32f0xx.h"
volatile int prev_button = false;
volatile int curr_button = false;
@@ -7,14 +7,14 @@ volatile int curr_button = false;
extern "C" void TIM2_IRQHandler(void){
if(TIM2->SR & TIM_SR_UIF){
TIM2->SR &= ~TIM_SR_UIF;
GPIOA->ODR ^= (1 << 5);
GPIOA->ODR ^= (1 << 4);
}
}
extern "C" void EXTI0_1_IRQHandler(void) {
if (EXTI->PR & (1 << 0)) { //Check pending flag
EXTI->PR |= (1 << 0); //Clear it by writing 1
GPIOA->ODR ^= (1 << 4);
GPIOA->ODR ^= (1 << 5);
}
}
@@ -54,7 +54,7 @@ int main() {
__enable_irq();
while (1) {
while (true) {
__WFI();
}
}