Basic vanilla C boilerplate for STM32L100xC (Discovery L100C). Uses GCC. This was some class project without much practical use
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
664 B

8 years ago
#include <common.h>
#include "utils/usart.h"
#include "utils/timebase.h"
#include "utils/debounce.h"
8 years ago
#include "init.h"
8 years ago
#include "blink.h"
8 years ago
void say_hello(void)
{
usart_tx_string(USART3, "HELLO\r\n");
}
8 years ago
/** IRQ */
void USART3_IRQHandler(void)
{
if (USART3_SR & USART_SR_ORE) {
USART3_SR &= ~USART_SR_ORE;
return;
}
blue_blink();
char c = usart_rx_char(USART3);
usart_tx_char(USART3, c);
USART3_SR ^= USART_SR_RXNE;
}
/** Called by startup script, before main() */
8 years ago
void SystemInit(void)
{
init_clock();
init_systick();
8 years ago
init_gpios();
init_usart();
init_adc();
8 years ago
8 years ago
register_periodic_task(green_toggle, 1000);
8 years ago
}
int main(void)
{
while (1);
8 years ago
}