1
0
forked from me/IronOS

Rename mode to make more sense

This commit is contained in:
Ben V. Brown
2016-09-17 00:00:47 +10:00
parent f355ff6c01
commit 4db03d5832
6 changed files with 61 additions and 74 deletions

View File

@@ -6,7 +6,7 @@ This is used for motion detection of the soldering iron.
# USB Disk
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
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
* Move all the settings to an on device menu system instead of usb link
* Move error codes into a unified struct
* Rewrite most of the OLED stack to not require hardcoded values
* Rework the modes of the unit to be neater

View File

@@ -19,11 +19,11 @@
#define EFFECTIVE_KEY_TIMER gTime[3]/*EFFECTIVE_KEY_TIMER*/
#define LEAVE_WAIT_TIMER gTime[4]/*LEAVE_WAIT_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 KD_TIMER gTime[7]/*<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ*/
#define UI_TIMER gTime[6]/*UI_TIMER */
#define KD_TIMER gTime[7]/**/
///^^-- 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 NO_KEY 0x0 /*NO Keys pressed*/
#define KEY_V1 0x0100/*V1 key pressed*/
@@ -34,10 +34,11 @@
typedef enum WORK_STATUS {
IDLE = 1, //System is idle
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
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??
ALARM, //An alarm has been fired
} WORK_STATUS;

View File

@@ -215,7 +215,7 @@ void Status_Tran(void) //
case KEY_V1: //If V1 key is pressed
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??
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
TEMPSHOW_TIMER= 0; //Initialize the timer to 0
UI_TIMER= 0;
@@ -247,7 +247,7 @@ void Status_Tran(void) //
gPre_status = IDLE;
}
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
case KEY_CN|KEY_V1:
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_LongKeyFlag(0);//Reset the long key press flag
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;
KD_TIMER = 50;//
break;
@@ -270,7 +270,7 @@ void Status_Tran(void) //
Set_HeatingTime(0);//Turn of heater as we are out of range
Set_LongKeyFlag(0);//reset key flag
Set_CtrlStatus(IDLE);//reset to IDLE state
gPre_status = TEMP_CTR;//set previous state
gPre_status = SOLDERING_MODE;//set previous state
gIs_restartkey = 1;
KD_TIMER = 50;//
}
@@ -360,7 +360,7 @@ void Status_Tran(void) //
UI_TIMER = 0; //reset the un-needed timers
G6_TIMER = 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??
@@ -374,7 +374,7 @@ void Status_Tran(void) //
gCalib_flag = 1;
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
}
break;
@@ -416,7 +416,7 @@ void Status_Tran(void) //
wk_temp = device_info.t_work;
gTemp_data = Get_Temp(wk_temp);
if(Get_AlarmType() == NORMAL_TEMP) {
Set_CtrlStatus(TEMP_CTR);
Set_CtrlStatus(SOLDERING_MODE);
Set_UpdataFlag(0);
}
break;

View File

@@ -30,7 +30,7 @@ int main(void) {
I2C_Configuration(); //init the i2c bus
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
System_Init(); //load known safe values
@@ -45,7 +45,7 @@ int main(void) {
while (1) {
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
LEAVE_WAIT_TIMER = 50;//reset timer so we dont poll accelerometer for another 500ms
}

View File

@@ -35,12 +35,9 @@ u8 gOled_param[46] = { 0x80, 0xAE, 0x80, 0xD5, 0x80, 0x52, 0x80, 0xA8, 0x80,
0xAF };
#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 };

View File

@@ -83,7 +83,7 @@ void APP_Init(void) {
Set_CtrlStatus(ALARM);
else if (rev >= 4) { //We are USB powered (5V approx at input)
Set_LongKeyFlag(1);
Set_CtrlStatus(CONFIG);
Set_CtrlStatus(USB_POWER);
} else { //Normal mode > ~9V at input
Set_CtrlStatus(IDLE);
G6_TIMER= device_info.idle_time;
@@ -381,16 +381,10 @@ void Show_Set(void) {
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) {
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>
i = 1;
@@ -452,18 +446,14 @@ u8 Reverse_Bin8(u8 data) {
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) {
static u32 j = 0, m = 0, po_j[3] = { 0, 0, 0 }, po_m[3] = { 0, 0, 16 };
u32 i, k;
if (direction == 0) { //up
if (gUp_flag == 0) { //ǰһ״̬<EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><EFBFBD><EFBFBD>
if (gUp_flag == 0) { //
j = 0;
m = 0;
gUp_flag = 1;
@@ -474,7 +464,7 @@ void Show_ReverseChar(u8* ptr, u8 num, u8 width, u8 direction) {
m = po_m[0];
}
} else if (direction == 1) {
if (gDown_flag == 0) { //ǰһ״̬<EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><EFBFBD><EFBFBD>
if (gDown_flag == 0) { //
j = 0;
m = 0;
gUp_flag = 0;
@@ -489,31 +479,31 @@ void Show_ReverseChar(u8* ptr, u8 num, u8 width, u8 direction) {
m = po_m[2];
}
for (i = 0; i < width * 2 * num; i++)
gTemp_array[i] = Reverse_Bin8(*(ptr + i)); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
gTemp_array[i] = Reverse_Bin8(*(ptr + i)); //
for (k = 0; k < width * 2 * num; k += width * 2)
for (i = 0; i < width; i++) {
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 (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
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><>
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
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 + width] = gTemp_array_u16[i + k] & 0x00FF;
}
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;
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>
word_num: <20><><EFBFBD><EFBFBD>
word_width: <20><><EFBFBD>
Show_TempReverse
word_num:
word_width:
direction : <20><><EFBFBD><EFBFBD> (0 up, 1 down)
*******************************************************************************/
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;
}
for (i = 0; i < width * 2; i++) {
gTemp_array[0 * 32 + i] = Reverse_Bin8(*(wordlib + b * 32 + i)); //<2F><><EFBFBD><EFBFBD>
gTemp_array[1 * 32 + i] = Reverse_Bin8(*(wordlib + s * 32 + i)); //<2F><><EFBFBD><EFBFBD>
gTemp_array[2 * 32 + i] = Reverse_Bin8(*(wordlib + g * 32 + i)); //<2F><><EFBFBD><EFBFBD>
gTemp_array[0 * 32 + i] = Reverse_Bin8(*(wordlib + b * 32 + i));
gTemp_array[1 * 32 + i] = Reverse_Bin8(*(wordlib + s * 32 + i));
gTemp_array[2 * 32 + i] = Reverse_Bin8(*(wordlib + g * 32 + i));
if (Get_TemperatureShowFlag() == 1) {
gTemp_array[3 * 32 + i] = Reverse_Bin8(*(wordlib + 15 * 32 + i)); //<2F><><EFBFBD><EFBFBD>
gTemp_array[3 * 32 + i] = Reverse_Bin8(*(wordlib + 15 * 32 + i));
} else {
gTemp_array[3 * 32 + i] = Reverse_Bin8(*(wordlib + 13 * 32 + i)); //<2F><><EFBFBD><EFBFBD>
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 (i = 0; i < width; i++) {
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>λ
if (direction == 0) { //<2F><>
| gTemp_array[i + k + width];
if (direction == 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
gTemp_array_u16[i + k] >>= m; //<2F><><EFBFBD><EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
gTemp_array_u16[i + k] >>= m;
} else {
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
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 + width] = gTemp_array_u16[i + k] & 0x00FF;
@@ -615,21 +605,19 @@ u8 Show_TempReverse(u8 num, u8 width, u8 direction) {
}
/*******************************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Show_HeatingIcon
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><>̬ѡ<CCAC><D1A1><EFBFBD><EFBFBD>ȵ<EFBFBD>״̬<D7B4><CCAC>ʶ
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ht_flag <20><><EFBFBD>±<EFBFBD>ʾ active <20>ƶ<EFBFBD><C6B6><EFBFBD>ʶ
<20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>:NULL
Function: Show_HeatingIcon
Draws the heating iron icon on the screen
*******************************************************************************/
void Show_HeatingIcon(u32 ht_flag, u16 active) {
u8* ptr;
memset(gTemp_array, 0, 20);
if (ht_flag == 0)
Show_ReverseChar((u8*) TempIcon, 1, 10, 0); //(5,ptr,16);//<2F><><EFBFBD><EFBFBD>//
Show_ReverseChar((u8*) TempIcon, 1, 10, 0); //(5,ptr,16);//<2F><><EFBFBD><EFBFBD>//
else if (ht_flag == 1)
Show_ReverseChar((u8*) TempIcon + 32, 1, 10, 1); //(5,ptr+32,16);//<2F><><EFBFBD><EFBFBD>//
else if (ht_flag == 2)
Show_OrderChar((u8*) TempIcon, 1, 10); //(5,ptr+64,16);//<2F><><EFBFBD><EFBFBD>//
Show_OrderChar((u8*) TempIcon, 1, 10); //(5,ptr+64,16);//<2F><><EFBFBD><EFBFBD>//
ptr = (u8*) gTemp_array;
Oled_DrawArea(86, 0, 10, 16, (u8*) ptr);
@@ -809,8 +797,7 @@ void Temp_SetProc(void) {
}
switch(Get_gKey()) {
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]) {
gTempset_showctrl = 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);
break;
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]) {
gTempset_showctrl = 1;
theRoll_num = Roll_Num(device_info.t_step,0);
@@ -879,7 +865,7 @@ void OLed_Display(void) {
Show_Notice();
UI_TIMER = 50;
}
if(G6_TIMER == 0) { //<2F><><EFBFBD><EFBFBD>
if(G6_TIMER == 0) {
id_cnt++;
if(id_cnt == 50)Sc_Pt(bk--);
if(bk == 0) Oled_DisplayOff();
@@ -891,7 +877,7 @@ void OLed_Display(void) {
Oled_DisplayOn();
}
break;
case TEMP_CTR:
case SOLDERING_MODE:
if(gCont == 0) {
gCont = 1;
Set_LongKeyFlag(1);
@@ -935,7 +921,7 @@ void OLed_Display(void) {
case TEMP_SET:
Temp_SetProc(); //<2F><><EFBFBD><EFBFBD>
break;
case CONFIG:
case USB_POWER:
if(gCont == 1) {
gCont = 0;
Clear_Screen();
@@ -1024,10 +1010,15 @@ void OLed_Display(void) {
temp_val = TemperatureShow_Change(0,temp_val);
}
Display_Temp(1,temp_val/10);
Show_HeatingIcon(ht_flag,Get_MmaActive()); //0<><30><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD>
Show_HeatingIcon(ht_flag,Get_MmaActive()); //0<><30><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD>
td_cnt++;
}
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:
break;
}