EPROMEmu/Src/main.c

36 lines
652 B
C
Raw Normal View History

2019-08-16 01:32:46 -07:00
#include "stm32f0xx_system.h"
#include "timers.h"
2019-08-14 08:25:23 -07:00
#include "adc.h"
#include "usart.h"
#include "gpio.h"
#include "shiftregister.h"
#include "commands.h"
#include <stdlib.h>
const char *firmware_version = "v0.1";
char line_buf[MAX_BUFFER_LENGTH];
2019-08-14 08:25:23 -07:00
int main(void)
{
// Reset of all peripherals, Initialises the Flash interface and the Systick.
2019-08-16 01:32:46 -07:00
HAL_Init();
2019-08-14 08:25:23 -07:00
2019-08-16 01:32:46 -07:00
// Configure the system clock
SystemClock_Config();
2019-08-14 08:25:23 -07:00
// Initialise all configured peripherals
2019-08-16 01:32:46 -07:00
initialise_gpio();
init_uart();
init_shift_registers();
2019-08-14 08:25:23 -07:00
2019-08-16 01:32:46 -07:00
while (1)
{
if (get_line(line_buf, sizeof(line_buf)))
{
decode_command(line_buf);
}
2019-08-16 01:32:46 -07:00
}
2019-08-14 08:25:23 -07:00
}