Startup of system. More...
#include <msp430.h>#include "pins.h"#include "gpio.h"#include "clock.h"#include "timer.h"#include "adc.h"#include "stepperAdvance.h"#include "fwdButton.h"#include "dcfReceive.h"#include "led.h"#include "timeKeeping.h"#include "pinInterrupts.h"#include "uart.h"#include "storeLoadMechanicalTime.h"Go to the source code of this file.
Functions | |
| void | main (void) |
| Main function that initializes system components and enters low-power mode. | |
Variables | |
| uint32_t | setTime |
| uint32_t | loaded_value |
Startup of system.
Definition in file main.c.
| void main | ( | void | ) |
Main function that initializes system components and enters low-power mode.
This function is responsible for setting up various system components, including the GPIO, ADC, clocks, and timekeeping system. It also loads the mechanical time from flash memory (if it is connected to a debugger the flash is cleared and the mechanical time must be set manually). It also initializes the UART (if enabled). Additionally, the function sets the time of the mechanical clock and enters low-power mode with interrupts enabled. The system performs various initialization tasks to ensure the proper operation of the application.
It performs the following steps:
UART_ENABLED is defined.Definition at line 54 of file main.c.
References load_from_flash(), loaded_value, mechanicalTimeFloat, resetTimeKeeping(), setTime, setupAdc(), setupClocks(), setupGpio(), setupTimer0(), setupTimer1(), timeOfLastDcfMessage, UART_Init(), UART_SendString(), UART_SendTime(), and write_SegD().
| uint32_t loaded_value |
Definition at line 33 of file main.c.
Referenced by load_from_flash(), and main().