Rename mode to make more sense
This commit is contained in:
@@ -6,7 +6,7 @@ This is used for motion detection of the soldering iron.
|
|||||||
|
|
||||||
# USB Disk
|
# USB Disk
|
||||||
When the unit is plugged into the computer, it presents a FAT device to the operating system over the usb connection.
|
When the unit is plugged into the computer, it presents a FAT device to the operating system over the usb connection.
|
||||||
This is implimented using a ram buffer for the disk.
|
This is implemented using a ram buffer for the disk.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -14,10 +14,8 @@ This is implimented using a ram buffer for the disk.
|
|||||||
# Future improvements to be made
|
# Future improvements to be made
|
||||||
These features are things I would like to add to the firmware
|
These features are things I would like to add to the firmware
|
||||||
|
|
||||||
* Use hardware PWM for driving the heating element.
|
|
||||||
* Use the sysTick hardware for timing of events
|
* Use the sysTick hardware for timing of events
|
||||||
* Move all the settings to an on device menu system instead of usb link
|
* Move all the settings to an on device menu system instead of usb link
|
||||||
* Move error codes into a unified struct
|
* Move error codes into a unified struct
|
||||||
* Rewrite most of the OLED stack to not require hardcoded values
|
* Rewrite most of the OLED stack to not require hardcoded values
|
||||||
* Rework the modes of the unit to be neater
|
* Rework the modes of the unit to be neater
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,11 @@
|
|||||||
#define EFFECTIVE_KEY_TIMER gTime[3]/*EFFECTIVE_KEY_TIMER*/
|
#define EFFECTIVE_KEY_TIMER gTime[3]/*EFFECTIVE_KEY_TIMER*/
|
||||||
#define LEAVE_WAIT_TIMER gTime[4]/*LEAVE_WAIT_TIMER*/
|
#define LEAVE_WAIT_TIMER gTime[4]/*LEAVE_WAIT_TIMER*/
|
||||||
#define G6_TIMER gTime[5]/*SWITCH_SHOW_TIMER*/
|
#define G6_TIMER gTime[5]/*SWITCH_SHOW_TIMER*/
|
||||||
#define UI_TIMER gTime[6]/*UI_TIMER ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
#define UI_TIMER gTime[6]/*UI_TIMER */
|
||||||
#define KD_TIMER gTime[7]/*<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ*/
|
#define KD_TIMER gTime[7]/**/
|
||||||
|
|
||||||
///^^-- All the times in gTime are decremented by 1 if >0 by timer2 tick <bottom of bios.c>
|
///^^-- All the times in gTime are decremented by 1 if >0 by timer2 tick <bottom of bios.c>
|
||||||
//------------------------------ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>------------------------------------//
|
//------------------------------ ------------------------------------//
|
||||||
#define KEY_ST(KEY_PIN) GPIO_ReadInputDataBit(GPIOA, KEY_PIN)
|
#define KEY_ST(KEY_PIN) GPIO_ReadInputDataBit(GPIOA, KEY_PIN)
|
||||||
#define NO_KEY 0x0 /*NO Keys pressed*/
|
#define NO_KEY 0x0 /*NO Keys pressed*/
|
||||||
#define KEY_V1 0x0100/*V1 key pressed*/
|
#define KEY_V1 0x0100/*V1 key pressed*/
|
||||||
@@ -34,10 +34,11 @@
|
|||||||
typedef enum WORK_STATUS {
|
typedef enum WORK_STATUS {
|
||||||
IDLE = 1, //System is idle
|
IDLE = 1, //System is idle
|
||||||
THERMOMETER, //Thermometer mode, basically reads sensor and shows temp
|
THERMOMETER, //Thermometer mode, basically reads sensor and shows temp
|
||||||
TEMP_CTR, //Soldering Mode (Temp Controlled)
|
SOLDERING_MODE, //Soldering Mode (Temp Controlled)
|
||||||
WAIT, //System in wait state
|
WAIT, //System in wait state
|
||||||
TEMP_SET, //Setting the soldering temp
|
TEMP_SET, //Setting the soldering temp
|
||||||
CONFIG, //system config mode
|
SETTINGS_MENU, // Show the user the settings menu
|
||||||
|
USB_POWER, //USB Powered Mode
|
||||||
MODE_CNG, //DFU mode i think??
|
MODE_CNG, //DFU mode i think??
|
||||||
ALARM, //An alarm has been fired
|
ALARM, //An alarm has been fired
|
||||||
} WORK_STATUS;
|
} WORK_STATUS;
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ void Status_Tran(void) //
|
|||||||
case KEY_V1: //If V1 key is pressed
|
case KEY_V1: //If V1 key is pressed
|
||||||
if (gIs_restartkey != 1) { //check we are not in a soft restart situation
|
if (gIs_restartkey != 1) { //check we are not in a soft restart situation
|
||||||
if (Read_Vb(1) < 4) { //Read that the input voltage is acceptable??
|
if (Read_Vb(1) < 4) { //Read that the input voltage is acceptable??
|
||||||
Set_CtrlStatus(TEMP_CTR); //Set to temperature controlled mode (Aka soldering mode)
|
Set_CtrlStatus(SOLDERING_MODE); //Set to temperature controlled mode (Aka soldering mode)
|
||||||
init_waitingtime = 0; //Initialize the wait count to 0
|
init_waitingtime = 0; //Initialize the wait count to 0
|
||||||
TEMPSHOW_TIMER= 0; //Initialize the timer to 0
|
TEMPSHOW_TIMER= 0; //Initialize the timer to 0
|
||||||
UI_TIMER= 0;
|
UI_TIMER= 0;
|
||||||
@@ -247,7 +247,7 @@ void Status_Tran(void) //
|
|||||||
gPre_status = IDLE;
|
gPre_status = IDLE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TEMP_CTR: //We are in soldering mode
|
case SOLDERING_MODE: //We are in soldering mode
|
||||||
switch(Get_gKey()) { //switch on the pressed key
|
switch(Get_gKey()) { //switch on the pressed key
|
||||||
case KEY_CN|KEY_V1:
|
case KEY_CN|KEY_V1:
|
||||||
case KEY_CN|KEY_V2://if either key long pressed
|
case KEY_CN|KEY_V2://if either key long pressed
|
||||||
@@ -260,7 +260,7 @@ void Status_Tran(void) //
|
|||||||
Set_HeatingTime(0);//Stop the heater
|
Set_HeatingTime(0);//Stop the heater
|
||||||
Set_LongKeyFlag(0);//Reset the long key press flag
|
Set_LongKeyFlag(0);//Reset the long key press flag
|
||||||
Set_CtrlStatus(IDLE);//Change the system back to IDLE state (stop soldering)
|
Set_CtrlStatus(IDLE);//Change the system back to IDLE state (stop soldering)
|
||||||
gPre_status = TEMP_CTR;//Set previous status
|
gPre_status = SOLDERING_MODE;//Set previous status
|
||||||
gIs_restartkey = 1;
|
gIs_restartkey = 1;
|
||||||
KD_TIMER = 50;//
|
KD_TIMER = 50;//
|
||||||
break;
|
break;
|
||||||
@@ -270,7 +270,7 @@ void Status_Tran(void) //
|
|||||||
Set_HeatingTime(0);//Turn of heater as we are out of range
|
Set_HeatingTime(0);//Turn of heater as we are out of range
|
||||||
Set_LongKeyFlag(0);//reset key flag
|
Set_LongKeyFlag(0);//reset key flag
|
||||||
Set_CtrlStatus(IDLE);//reset to IDLE state
|
Set_CtrlStatus(IDLE);//reset to IDLE state
|
||||||
gPre_status = TEMP_CTR;//set previous state
|
gPre_status = SOLDERING_MODE;//set previous state
|
||||||
gIs_restartkey = 1;
|
gIs_restartkey = 1;
|
||||||
KD_TIMER = 50;//
|
KD_TIMER = 50;//
|
||||||
}
|
}
|
||||||
@@ -360,7 +360,7 @@ void Status_Tran(void) //
|
|||||||
UI_TIMER = 0; //reset the un-needed timers
|
UI_TIMER = 0; //reset the un-needed timers
|
||||||
G6_TIMER = 0;
|
G6_TIMER = 0;
|
||||||
init_waitingtime = 0;
|
init_waitingtime = 0;
|
||||||
Set_CtrlStatus(TEMP_CTR);//Go back to soldering iron mode
|
Set_CtrlStatus(SOLDERING_MODE);//Go back to soldering iron mode
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Get_AlarmType() > NORMAL_TEMP) { //If an alarm has occurred??
|
if(Get_AlarmType() > NORMAL_TEMP) { //If an alarm has occurred??
|
||||||
@@ -374,7 +374,7 @@ void Status_Tran(void) //
|
|||||||
gCalib_flag = 1;
|
gCalib_flag = 1;
|
||||||
|
|
||||||
gCalib_flag = 0;
|
gCalib_flag = 0;
|
||||||
Set_CtrlStatus(TEMP_CTR); //return to soldering mode
|
Set_CtrlStatus(SOLDERING_MODE); //return to soldering mode
|
||||||
TEMPSHOW_TIMER = 0;//turn off the timer
|
TEMPSHOW_TIMER = 0;//turn off the timer
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -416,7 +416,7 @@ void Status_Tran(void) //
|
|||||||
wk_temp = device_info.t_work;
|
wk_temp = device_info.t_work;
|
||||||
gTemp_data = Get_Temp(wk_temp);
|
gTemp_data = Get_Temp(wk_temp);
|
||||||
if(Get_AlarmType() == NORMAL_TEMP) {
|
if(Get_AlarmType() == NORMAL_TEMP) {
|
||||||
Set_CtrlStatus(TEMP_CTR);
|
Set_CtrlStatus(SOLDERING_MODE);
|
||||||
Set_UpdataFlag(0);
|
Set_UpdataFlag(0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ int main(void) {
|
|||||||
I2C_Configuration(); //init the i2c bus
|
I2C_Configuration(); //init the i2c bus
|
||||||
|
|
||||||
Adc_Init(); //init adc and dma
|
Adc_Init(); //init adc and dma
|
||||||
if (Get_CtrlStatus() != CONFIG)
|
if (Get_CtrlStatus() != USB_POWER)
|
||||||
StartUp_Accelerated(); //start the accelerometer if not in config mode
|
StartUp_Accelerated(); //start the accelerometer if not in config mode
|
||||||
|
|
||||||
System_Init(); //load known safe values
|
System_Init(); //load known safe values
|
||||||
@@ -45,7 +45,7 @@ int main(void) {
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
Clear_Watchdog(); //reset the Watchdog
|
Clear_Watchdog(); //reset the Watchdog
|
||||||
if (Get_CtrlStatus() != CONFIG && LEAVE_WAIT_TIMER== 0) {
|
if (Get_CtrlStatus() != USB_POWER && LEAVE_WAIT_TIMER== 0) {
|
||||||
Check_Accelerated(); //update readings from the accelerometer
|
Check_Accelerated(); //update readings from the accelerometer
|
||||||
LEAVE_WAIT_TIMER = 50;//reset timer so we dont poll accelerometer for another 500ms
|
LEAVE_WAIT_TIMER = 50;//reset timer so we dont poll accelerometer for another 500ms
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,12 +35,9 @@ u8 gOled_param[46] = { 0x80, 0xAE, 0x80, 0xD5, 0x80, 0x52, 0x80, 0xA8, 0x80,
|
|||||||
0xAF };
|
0xAF };
|
||||||
#endif
|
#endif
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Sc_Pt
|
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>Ļ<EFBFBD>Աȶ<D4B1>
|
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:Co<43><6F>Ļ<EFBFBD>ԱȶȲ<C8B6><C8B2><EFBFBD>
|
|
||||||
<20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>:NULL
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void Sc_Pt(u8 Co) //<2F><>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD>
|
void Sc_Pt(u8 Co)
|
||||||
{
|
{
|
||||||
u8 pt[4] = { 0x80, 0x81, 0x80, Co };
|
u8 pt[4] = { 0x80, 0x81, 0x80, Co };
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ void APP_Init(void) {
|
|||||||
Set_CtrlStatus(ALARM);
|
Set_CtrlStatus(ALARM);
|
||||||
else if (rev >= 4) { //We are USB powered (5V approx at input)
|
else if (rev >= 4) { //We are USB powered (5V approx at input)
|
||||||
Set_LongKeyFlag(1);
|
Set_LongKeyFlag(1);
|
||||||
Set_CtrlStatus(CONFIG);
|
Set_CtrlStatus(USB_POWER);
|
||||||
} else { //Normal mode > ~9V at input
|
} else { //Normal mode > ~9V at input
|
||||||
Set_CtrlStatus(IDLE);
|
Set_CtrlStatus(IDLE);
|
||||||
G6_TIMER= device_info.idle_time;
|
G6_TIMER= device_info.idle_time;
|
||||||
@@ -381,16 +381,10 @@ void Show_Set(void) {
|
|||||||
Shift_Char((u8*) Triangle + 1 * 32, 5);
|
Shift_Char((u8*) Triangle + 1 * 32, 5);
|
||||||
}
|
}
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Show_OrderChar
|
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD>̬<EFBFBD><CCAC>ʾ<EFBFBD>ַ<EFBFBD>
|
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ptr:<3A>ֽڿ<D6BD>num:<3A><><EFBFBD><EFBFBD>width:<3A><><EFBFBD>
|
|
||||||
<20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>:NULL
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void Show_OrderChar(u8* ptr, u8 num, u8 width) {
|
void Show_OrderChar(u8* ptr, u8 num, u8 width) {
|
||||||
static u8 i = 1, j = 0, k = 0, m = 10;
|
static u8 i = 1, j = 0, k = 0, m = 10;
|
||||||
//i<><69>Դ<EFBFBD><D4B4><EFBFBD>鿪ʼλ
|
|
||||||
//j<><6A>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD>鿪ʼλ
|
|
||||||
//m<><6D><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
|
|
||||||
|
|
||||||
if (gLevel_flag == 0) { //ǰһ״̬<D7B4><CCAC><EFBFBD>Ǻ<EFBFBD><C7BA><EFBFBD>
|
if (gLevel_flag == 0) { //ǰһ״̬<D7B4><CCAC><EFBFBD>Ǻ<EFBFBD><C7BA><EFBFBD>
|
||||||
i = 1;
|
i = 1;
|
||||||
@@ -452,18 +446,14 @@ u8 Reverse_Bin8(u8 data) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Show_ReverseChar
|
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD>̬<EFBFBD><CCAC>ʾ<EFBFBD>ַ<EFBFBD>
|
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ptr:<3A>ֽڿ<D6BD> num:<3A><><EFBFBD><EFBFBD>
|
|
||||||
width:<3A><><EFBFBD> direction :<3A><><EFBFBD><EFBFBD> (0 up, 1 down)
|
|
||||||
<20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>:NULL
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void Show_ReverseChar(u8* ptr, u8 num, u8 width, u8 direction) {
|
void Show_ReverseChar(u8* ptr, u8 num, u8 width, u8 direction) {
|
||||||
static u32 j = 0, m = 0, po_j[3] = { 0, 0, 0 }, po_m[3] = { 0, 0, 16 };
|
static u32 j = 0, m = 0, po_j[3] = { 0, 0, 0 }, po_m[3] = { 0, 0, 16 };
|
||||||
u32 i, k;
|
u32 i, k;
|
||||||
|
|
||||||
if (direction == 0) { //up
|
if (direction == 0) { //up
|
||||||
if (gUp_flag == 0) { //ǰһ״̬<EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><EFBFBD><EFBFBD>
|
if (gUp_flag == 0) { //
|
||||||
j = 0;
|
j = 0;
|
||||||
m = 0;
|
m = 0;
|
||||||
gUp_flag = 1;
|
gUp_flag = 1;
|
||||||
@@ -474,7 +464,7 @@ void Show_ReverseChar(u8* ptr, u8 num, u8 width, u8 direction) {
|
|||||||
m = po_m[0];
|
m = po_m[0];
|
||||||
}
|
}
|
||||||
} else if (direction == 1) {
|
} else if (direction == 1) {
|
||||||
if (gDown_flag == 0) { //ǰһ״̬<EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><EFBFBD><EFBFBD>
|
if (gDown_flag == 0) { //
|
||||||
j = 0;
|
j = 0;
|
||||||
m = 0;
|
m = 0;
|
||||||
gUp_flag = 0;
|
gUp_flag = 0;
|
||||||
@@ -489,31 +479,31 @@ void Show_ReverseChar(u8* ptr, u8 num, u8 width, u8 direction) {
|
|||||||
m = po_m[2];
|
m = po_m[2];
|
||||||
}
|
}
|
||||||
for (i = 0; i < width * 2 * num; i++)
|
for (i = 0; i < width * 2 * num; i++)
|
||||||
gTemp_array[i] = Reverse_Bin8(*(ptr + i)); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>8λ
|
gTemp_array[i] = Reverse_Bin8(*(ptr + i)); //
|
||||||
|
|
||||||
for (k = 0; k < width * 2 * num; k += width * 2)
|
for (k = 0; k < width * 2 * num; k += width * 2)
|
||||||
for (i = 0; i < width; i++) {
|
for (i = 0; i < width; i++) {
|
||||||
gTemp_array_u16[i + k] = ((gTemp_array[i + k] & 0x00FF) << 8)
|
gTemp_array_u16[i + k] = ((gTemp_array[i + k] & 0x00FF) << 8)
|
||||||
| gTemp_array[i + k + width]; //<EFBFBD>ϰ벿<EFBFBD>°벿<EFBFBD><EFBFBD><EFBFBD>u16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
| gTemp_array[i + k + width]; //
|
||||||
if (direction == 1) {
|
if (direction == 1) {
|
||||||
if (j == 0)
|
if (j == 0)
|
||||||
gTemp_array_u16[i + k] <<= m; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
gTemp_array_u16[i + k] <<= m; //
|
||||||
else
|
else
|
||||||
gTemp_array_u16[i + k] >>= j; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
gTemp_array_u16[i + k] >>= j; //
|
||||||
} else { //<2F><>
|
} else { //<2F><>
|
||||||
if (m == 0)
|
if (m == 0)
|
||||||
gTemp_array_u16[i + k] <<= j; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
gTemp_array_u16[i + k] <<= j; //
|
||||||
else
|
else
|
||||||
gTemp_array_u16[i + k] >>= m; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
gTemp_array_u16[i + k] >>= m; //
|
||||||
}
|
}
|
||||||
gTemp_array[i + k] = (gTemp_array_u16[i + k] & 0xFF00) >> 8;
|
gTemp_array[i + k] = (gTemp_array_u16[i + k] & 0xFF00) >> 8;
|
||||||
gTemp_array[i + k + width] = gTemp_array_u16[i + k] & 0x00FF;
|
gTemp_array[i + k + width] = gTemp_array_u16[i + k] & 0x00FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < width * 2 * num; i++)
|
for (i = 0; i < width * 2 * num; i++)
|
||||||
gTemp_array[i] = Reverse_Bin8(gTemp_array[i]); //<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
gTemp_array[i] = Reverse_Bin8(gTemp_array[i]); //
|
||||||
|
|
||||||
if (m == 0 && j == 16) { //ȫ<><C8AB>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ'ͷ<><CDB7>'
|
if (m == 0 && j == 16) {
|
||||||
j = 0;
|
j = 0;
|
||||||
m = 16;
|
m = 16;
|
||||||
}
|
}
|
||||||
@@ -535,9 +525,9 @@ void Show_ReverseChar(u8* ptr, u8 num, u8 width, u8 direction) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
Show_TempReverse <20><><EFBFBD><EFBFBD>̬<EFBFBD><CCAC>ʾ<EFBFBD>¶<EFBFBD><C2B6>ַ<EFBFBD>
|
Show_TempReverse
|
||||||
word_num: <20><><EFBFBD><EFBFBD>
|
word_num:
|
||||||
word_width: <20><><EFBFBD>
|
word_width:
|
||||||
direction : <20><><EFBFBD><EFBFBD> (0 up, 1 down)
|
direction : <20><><EFBFBD><EFBFBD> (0 up, 1 down)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
u8 Show_TempReverse(u8 num, u8 width, u8 direction) {
|
u8 Show_TempReverse(u8 num, u8 width, u8 direction) {
|
||||||
@@ -567,30 +557,30 @@ u8 Show_TempReverse(u8 num, u8 width, u8 direction) {
|
|||||||
gTempset_showctrl = 0;
|
gTempset_showctrl = 0;
|
||||||
}
|
}
|
||||||
for (i = 0; i < width * 2; i++) {
|
for (i = 0; i < width * 2; i++) {
|
||||||
gTemp_array[0 * 32 + i] = Reverse_Bin8(*(wordlib + b * 32 + i)); //<2F><><EFBFBD><EFBFBD>8λ
|
gTemp_array[0 * 32 + i] = Reverse_Bin8(*(wordlib + b * 32 + i));
|
||||||
gTemp_array[1 * 32 + i] = Reverse_Bin8(*(wordlib + s * 32 + i)); //<2F><><EFBFBD><EFBFBD>8λ
|
gTemp_array[1 * 32 + i] = Reverse_Bin8(*(wordlib + s * 32 + i));
|
||||||
gTemp_array[2 * 32 + i] = Reverse_Bin8(*(wordlib + g * 32 + i)); //<2F><><EFBFBD><EFBFBD>8λ
|
gTemp_array[2 * 32 + i] = Reverse_Bin8(*(wordlib + g * 32 + i));
|
||||||
if (Get_TemperatureShowFlag() == 1) {
|
if (Get_TemperatureShowFlag() == 1) {
|
||||||
gTemp_array[3 * 32 + i] = Reverse_Bin8(*(wordlib + 15 * 32 + i)); //<2F><><EFBFBD><EFBFBD>8λ
|
gTemp_array[3 * 32 + i] = Reverse_Bin8(*(wordlib + 15 * 32 + i));
|
||||||
} else {
|
} else {
|
||||||
gTemp_array[3 * 32 + i] = Reverse_Bin8(*(wordlib + 13 * 32 + i)); //<2F><><EFBFBD><EFBFBD>8λ
|
gTemp_array[3 * 32 + i] = Reverse_Bin8(*(wordlib + 13 * 32 + i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//<2F><EFBFBD>K <20>ij<EFBFBD>ʼֵ<CABC>ܸı俪ʼ<E4BFAA><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>λ<EFBFBD>ø<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ʮλ<CAAE><CEBB><EFBFBD>ǰ<EFBFBD>λ
|
|
||||||
for (k = (3 - num) * width * 2; k < width * 2 * 3; k += width * 2)
|
for (k = (3 - num) * width * 2; k < width * 2 * 3; k += width * 2)
|
||||||
for (i = 0; i < width; i++) {
|
for (i = 0; i < width; i++) {
|
||||||
gTemp_array_u16[i + k] = ((gTemp_array[i + k] & 0x00FF) << 8)
|
gTemp_array_u16[i + k] = ((gTemp_array[i + k] & 0x00FF) << 8)
|
||||||
| gTemp_array[i + k + width]; //<2F>ϰ벿<CFB0>°벿<C2B0><EBB2BF><EFBFBD>u16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
| gTemp_array[i + k + width];
|
||||||
if (direction == 0) { //<2F><>
|
if (direction == 0) {
|
||||||
if (m == 0)
|
if (m == 0)
|
||||||
gTemp_array_u16[i + k] <<= j; //<2F><><EFBFBD><EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
gTemp_array_u16[i + k] <<= j;
|
||||||
else
|
else
|
||||||
gTemp_array_u16[i + k] >>= m; //<2F><><EFBFBD><EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
gTemp_array_u16[i + k] >>= m;
|
||||||
} else {
|
} else {
|
||||||
if (j == 0)
|
if (j == 0)
|
||||||
gTemp_array_u16[i + k] <<= m; //<2F><><EFBFBD><EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
gTemp_array_u16[i + k] <<= m;
|
||||||
else
|
else
|
||||||
gTemp_array_u16[i + k] >>= j; //<2F><><EFBFBD><EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
gTemp_array_u16[i + k] >>= j;
|
||||||
}
|
}
|
||||||
gTemp_array[i + k] = (gTemp_array_u16[i + k] & 0xFF00) >> 8;
|
gTemp_array[i + k] = (gTemp_array_u16[i + k] & 0xFF00) >> 8;
|
||||||
gTemp_array[i + k + width] = gTemp_array_u16[i + k] & 0x00FF;
|
gTemp_array[i + k + width] = gTemp_array_u16[i + k] & 0x00FF;
|
||||||
@@ -615,10 +605,8 @@ u8 Show_TempReverse(u8 num, u8 width, u8 direction) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Show_HeatingIcon
|
Function: Show_HeatingIcon
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><>̬ѡ<CCAC><D1A1><EFBFBD><EFBFBD>ȵ<EFBFBD>״̬<D7B4><CCAC>ʶ
|
Draws the heating iron icon on the screen
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ht_flag <20><><EFBFBD>±<EFBFBD>ʾ active <20>ƶ<EFBFBD><C6B6><EFBFBD>ʶ
|
|
||||||
<20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>:NULL
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void Show_HeatingIcon(u32 ht_flag, u16 active) {
|
void Show_HeatingIcon(u32 ht_flag, u16 active) {
|
||||||
u8* ptr;
|
u8* ptr;
|
||||||
@@ -809,8 +797,7 @@ void Temp_SetProc(void) {
|
|||||||
}
|
}
|
||||||
switch(Get_gKey()) {
|
switch(Get_gKey()) {
|
||||||
case KEY_V1:
|
case KEY_V1:
|
||||||
//<2F><><EFBFBD><EFBFBD>,<2C><><EFBFBD>·<EFBFBD>,<2C><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>ʧ
|
|
||||||
//<2F><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
|
|
||||||
if(device_info.t_work > gSet_table[1]) {
|
if(device_info.t_work > gSet_table[1]) {
|
||||||
gTempset_showctrl = 1;
|
gTempset_showctrl = 1;
|
||||||
theRoll_num = Roll_Num(device_info.t_step,1);
|
theRoll_num = Roll_Num(device_info.t_step,1);
|
||||||
@@ -824,8 +811,7 @@ void Temp_SetProc(void) {
|
|||||||
if(device_info.t_work == gSet_table[1]) Show_Triangle(0,1);
|
if(device_info.t_work == gSet_table[1]) Show_Triangle(0,1);
|
||||||
break;
|
break;
|
||||||
case KEY_V2:
|
case KEY_V2:
|
||||||
//<2F><><EFBFBD><EFBFBD>,<2C><><EFBFBD>Ϸ<EFBFBD>,<2C><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>ʧ
|
|
||||||
//<2F><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
|
|
||||||
if(device_info.t_work < gSet_table[0]) {
|
if(device_info.t_work < gSet_table[0]) {
|
||||||
gTempset_showctrl = 1;
|
gTempset_showctrl = 1;
|
||||||
theRoll_num = Roll_Num(device_info.t_step,0);
|
theRoll_num = Roll_Num(device_info.t_step,0);
|
||||||
@@ -879,7 +865,7 @@ void OLed_Display(void) {
|
|||||||
Show_Notice();
|
Show_Notice();
|
||||||
UI_TIMER = 50;
|
UI_TIMER = 50;
|
||||||
}
|
}
|
||||||
if(G6_TIMER == 0) { //<2F><><EFBFBD><EFBFBD>
|
if(G6_TIMER == 0) {
|
||||||
id_cnt++;
|
id_cnt++;
|
||||||
if(id_cnt == 50)Sc_Pt(bk--);
|
if(id_cnt == 50)Sc_Pt(bk--);
|
||||||
if(bk == 0) Oled_DisplayOff();
|
if(bk == 0) Oled_DisplayOff();
|
||||||
@@ -891,7 +877,7 @@ void OLed_Display(void) {
|
|||||||
Oled_DisplayOn();
|
Oled_DisplayOn();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TEMP_CTR:
|
case SOLDERING_MODE:
|
||||||
if(gCont == 0) {
|
if(gCont == 0) {
|
||||||
gCont = 1;
|
gCont = 1;
|
||||||
Set_LongKeyFlag(1);
|
Set_LongKeyFlag(1);
|
||||||
@@ -935,7 +921,7 @@ void OLed_Display(void) {
|
|||||||
case TEMP_SET:
|
case TEMP_SET:
|
||||||
Temp_SetProc(); //<2F><><EFBFBD><EFBFBD>
|
Temp_SetProc(); //<2F><><EFBFBD><EFBFBD>
|
||||||
break;
|
break;
|
||||||
case CONFIG:
|
case USB_POWER:
|
||||||
if(gCont == 1) {
|
if(gCont == 1) {
|
||||||
gCont = 0;
|
gCont = 0;
|
||||||
Clear_Screen();
|
Clear_Screen();
|
||||||
@@ -1028,6 +1014,11 @@ void OLed_Display(void) {
|
|||||||
td_cnt++;
|
td_cnt++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SETTINGS_MENU:
|
||||||
|
//We are in the menu structure.
|
||||||
|
//We need to move through the selected menu items, or if the user has hit the EOL then jump back to IDLE
|
||||||
|
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user