aboutsummaryrefslogtreecommitdiffhomepage
path: root/workspace/ts100/src/Main.c
diff options
context:
space:
mode:
Diffstat (limited to 'workspace/ts100/src/Main.c')
-rw-r--r--workspace/ts100/src/Main.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/workspace/ts100/src/Main.c b/workspace/ts100/src/Main.c
index 8d4c9c85..c898c3ab 100644
--- a/workspace/ts100/src/Main.c
+++ b/workspace/ts100/src/Main.c
@@ -12,30 +12,31 @@
void setup();
int main(void) {
- setup();
+ setup();/*Setup the system*/
while (1) {
- Clear_Watchdog(); //reset the Watchdog
+ Clear_Watchdog(); //reset the Watchdog timer
ProcessUI();
DrawUI();
- delayMs(50);
+ delayMs(50); //Slow the system down a little bit
}
}
-void setup()
-{
- RCC_Config(); //setup system clock
- NVIC_Config(0x4000); //this shifts the NVIC table to be offset, for the usb bootloader's size
- GPIO_Config(); //setup all the GPIO pins
- Init_EXTI(); //init the EXTI inputs
- Init_Timer3(); //Used for the soldering iron tip
- Adc_Init(); //init adc and dma
- I2C_Configuration(); //Start the I2C hardware
- GPIO_Init_OLED(); //Init the GPIO ports for the OLED
- StartUp_Accelerometer(); //start the accelerometer
- Init_Oled(); //init the OLED display
- Clear_Screen(); //clear the display buffer to black
- setupPID(); //init the PID values
- readIronTemp(239, 0); //load the default calibration value
- restoreSettings(); //Load settings
-
- Start_Watchdog(1000); //start the system watchdog as 1 seconds timeout
+void setup() {
+ RCC_Config(); //setup system clock
+ NVIC_Config(0x4000); //this shifts the NVIC table to be offset, for the usb bootloader's size
+ GPIO_Config(); //setup all the GPIO pins
+ Init_EXTI(); //init the EXTI inputs
+ Init_Timer3(); //Used for the soldering iron tip
+ Adc_Init(); //init adc and dma
+ I2C_Configuration(); //Start the I2C hardware
+ GPIO_Init_OLED(); //Init the GPIO ports for the OLED
+ StartUp_Accelerometer(); //start the accelerometer
+ Init_Oled(); //init the OLED display
+ setupPID(); //init the PID values
+ readIronTemp(239, 0); //load the default calibration value
+ restoreSettings(); //Load settings
+ if (systemSettings.flipDisplay)
+ Oled_DisplayFlip();
+ OLED_DrawString("VER 1.01",8);
+ delayMs(800);
+ Start_Watchdog(1000); //start the system watchdog as 1 seconds timeout
}