19 lines
588 B
C
Raw Normal View History

2021-05-11 09:12:06 +01:00
// Copyright (c) 2018-2021 Cesanta Software Limited
// All rights reserved
2021-05-11 18:05:03 +01:00
#include "mcu.h"
2021-05-11 09:12:06 +01:00
2021-05-11 18:05:03 +01:00
// These are NUCLEO-F103RB settings - adjust for your specific board
#define RAM_SIZE 20480 // RAM size on this device, needed by link.ld
#define ROM_SIZE 131072 // Flash size for this device, needed by link.ld
#define LED1 PIN('A', 5) // On-board LED pin
2021-05-11 09:12:06 +01:00
static inline void led_toggle(void) {
2021-05-11 18:05:03 +01:00
gpio_toggle(LED1);
2021-05-11 09:12:06 +01:00
}
static inline void init_hardware(void) {
2021-05-11 18:05:03 +01:00
RCC->APB2ENR |= BIT(2) | BIT(3) | BIT(4); // Init GPIO banks A,B,C
gpio_init(LED1, OUTPUT); // Set LED
2021-05-11 09:12:06 +01:00
}