fixed some bugs

This commit is contained in:
Edward Emelianov
2026-07-16 22:42:30 +03:00
parent f2a444c90e
commit 013a0b041c
9 changed files with 50 additions and 39 deletions

View File

@@ -1,4 +1,5 @@
BINARY := blink
PREFIX := /usr/bin/arm-none-eabi
# MCU code
MCU := G431xx
# change this linking script depending on particular MCU model,

Binary file not shown.

View File

@@ -38,6 +38,7 @@ void sys_tick_handler(void){
static void gpio_setup(void){
RCC->AHB2ENR = RCC_AHB2ENR_GPIOCEN; // enable PC
__DSB();
// set PC6 as push-pull output, PC13 is pulldown input, other as default (AIN)
GPIOC->MODER = (0xffffffff & ~(GPIO_MODER_MODE6 | GPIO_MODER_MODE13)) | MODER_O(6) | MODER_I(13);
GPIOC->PUPDR = PUPD_PD(13); // pulldown