-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathmain.c
More file actions
51 lines (45 loc) · 1.53 KB
/
main.c
File metadata and controls
51 lines (45 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// * This file is part of the Tinymovr-Firmware distribution
// * (https://github.com/yconst/tinymovr-firmware).
// * Copyright (c) 2020-2023 Ioannis Chatzikonstantinou.
// *
// * This program is free software: you can redistribute it and/or modify
// * it under the terms of the GNU General Public License as published by
// * the Free Software Foundation, version 3.
// *
// * This program is distributed in the hope that it will be useful, but
// * WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// * General Public License for more details.
// *
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "src/common.h"
#include "src/system/system.h"
#include "src/uart/uart_lowlevel.h"
#include <src/sensor/sensor.h>
#include "src/observer/observer.h"
#include "src/adc/adc.h"
#include "src/motor/motor.h"
#include "src/controller/controller.h"
#include "src/gatedriver/gatedriver.h"
#include "src/timer/timer.h"
#include "src/can/can.h"
#include "src/nvm/nvm.h"
#include "src/watchdog/watchdog.h"
int main(void)
{
__disable_irq();
system_init();
UART_Init(); // Keep UART init before config load for now
if (!nvm_load_config())
{
sensors_init_with_defaults();
observers_init_with_defaults();
}
ADC_init();
CAN_init();
timers_init();
Watchdog_init();
__enable_irq();
Controller_ControlLoop();
}