#include "arch.h" #include "core/clock.h" #include "core/dma.h" #include "core/gpio.h" #include "core/isr_vector.h" #include "core/system.h" #include "core/usart.h" #include "delay.h" #include "lib.h" #include "mem.h" #include "spin.h" #include "string.h" #ifdef ARCH_STM32L4 /** Overrides the default systick irq handler. */ void on_systick() { static int is_on = 0; __IO gpio_port_t* port_b = enable_gpio(GPIO_PORT_B); gpio_output_pin_t pin3 = set_gpio_pin_output(port_b, PIN_3); if (is_on) { pin_off(pin3); } else { pin_on(pin3); } is_on = ! is_on; } /* Main function. This gets executed from the interrupt vector defined above. */ int main() { /* Enable a higher clock frequency. */ set_system_clock_MHz(80); /* Set the countdown to start from 1,000,0000. */ SCB.strv_r = 10000000; /* Enable interrupts. */ SCB.stcs_bf.tickint = 1; /* Start the systick. */ SCB.stcs_bf.enable = 1; } #endif