mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
removing old files as eclipse builds now
Added #define organisation over mfg logo (no actual build effect though just for neatness) Creating a CubeMX project to match settings for future use More comments and cleaning up
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. **********************
|
||||
File Name : main.c
|
||||
Version : S100 APP Ver 2.11
|
||||
Description:
|
||||
Author : Celery
|
||||
Data: 2015/07/07
|
||||
History:
|
||||
2015/07/07 ͳһ<CDB3><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*******************************************************************************/
|
||||
File Name : main.c
|
||||
Version : S100 APP Ver 2.11
|
||||
Description:
|
||||
Author : Celery
|
||||
Data: 2015/07/07
|
||||
History:
|
||||
2016/8/11 Updates by Ben V. Brown <ralim@ralimtek.com> - Cleanup and english comments
|
||||
2015/07/07 ͳһ<CDB3><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*******************************************************************************/
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "APP_Version.h"
|
||||
@@ -20,50 +21,42 @@ History:
|
||||
#include "Oled.h"
|
||||
#include "CTRL.h"
|
||||
#include "Hardware.h"
|
||||
int main(void) {
|
||||
RCC_Config(); //setup system clock
|
||||
NVIC_Config(0x4000);
|
||||
Init_Timer2(); //init the timer
|
||||
Init_Timer3();
|
||||
GPIO_Config();
|
||||
USB_Port(DISABLE);
|
||||
Delay_Ms(200);
|
||||
USB_Port(ENABLE);
|
||||
USB_Init();
|
||||
I2C_Configuration(); //init the i2c bus
|
||||
|
||||
/*******************************************************************************
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: main
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><>ѭ<EFBFBD><D1AD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:NULL
|
||||
<EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD><EFBFBD><EFBFBD>:NULL
|
||||
*******************************************************************************/
|
||||
int main(void)
|
||||
{
|
||||
RCC_Config();
|
||||
NVIC_Config(0x4000);
|
||||
Init_Timer2();
|
||||
Init_Timer3();
|
||||
GPIO_Config();
|
||||
USB_Port(DISABLE);
|
||||
Delay_Ms(200);
|
||||
USB_Port(ENABLE);
|
||||
USB_Init();
|
||||
I2C_Configuration();
|
||||
|
||||
Ad_Init();
|
||||
if (Get_CtrlStatus() != CONFIG) StartUp_Accelerated();
|
||||
|
||||
System_Init();
|
||||
Init_Oled();
|
||||
Clear_Screen();
|
||||
Init_Gtime();
|
||||
APP_Init();
|
||||
|
||||
Disk_BuffInit();
|
||||
Config_Analysis(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>U<EFBFBD><55>
|
||||
|
||||
Pid_Init();
|
||||
Set_gKey(NO_KEY);
|
||||
Start_Watchdog(3000);
|
||||
|
||||
while (1) {
|
||||
Clear_Watchdog();
|
||||
if (Get_CtrlStatus() != CONFIG && LEAVE_WAIT_TIMER == 0) {
|
||||
Check_Accelerated();
|
||||
LEAVE_WAIT_TIMER = 50;
|
||||
}
|
||||
OLed_Display(); //<2F><>ʾCtrl_status
|
||||
Status_Tran(); //<2F><><EFBFBD>ݵ<EFBFBD>ǰ״̬<D7B4><CCAC><EFBFBD><EFBFBD>ϰ<EFBFBD><CFB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ת<EFBFBD><D7AA>
|
||||
}
|
||||
Adc_Init(); //init adc and dma
|
||||
if (Get_CtrlStatus() != CONFIG)
|
||||
StartUp_Accelerated();
|
||||
|
||||
System_Init();
|
||||
Init_Oled();
|
||||
Clear_Screen();
|
||||
Init_Gtime();
|
||||
APP_Init();
|
||||
|
||||
Disk_BuffInit();
|
||||
Config_Analysis(); //read in config from virtual disk
|
||||
Pid_Init(); //init the pid to starting values
|
||||
Set_gKey(NO_KEY); //reset keys
|
||||
Start_Watchdog(3000);
|
||||
|
||||
while (1) {
|
||||
Clear_Watchdog(); //reset the Watchdog
|
||||
if (Get_CtrlStatus() != CONFIG && LEAVE_WAIT_TIMER== 0) {
|
||||
Check_Accelerated(); //update readings from the accelerometer
|
||||
LEAVE_WAIT_TIMER = 50;
|
||||
}
|
||||
OLed_Display(); //Draw in the Oled display
|
||||
Status_Tran(); //Handle user input and mode changing
|
||||
}
|
||||
}
|
||||
/******************************** END OF FILE *********************************/
|
||||
|
||||
Reference in New Issue
Block a user