    if(LL_Battery_Charge__isCablePlugged()) { 
                LL_Power_BeforeSleep(); 
                LL_Power_Sleep();             
    }

		extern uint8_t led_num;
		
    while(1) {
                E_LL_LED lights[] = { 
                    E_LL_LED_PCB_B,
                    E_LL_LED_PCB_G,
                    E_LL_LED_PCB_R,
                    E_LL_PWM_FRONT_WHITE,//E_LL_PWM_WHITE,
                    E_LL_PWM_RED1,
                    E_LL_PWM_RED2,
                    E_LL_PWM_FRONT_RED,//E_LL_PWM_COB_RED,
                    E_LL_PWM_FRONT_YELLOW,//E_LL_PWM_COB_YELLOW,
                }; 
                //
								if(led_num == 0)
								{
									LL_LED_ON(E_LL_LED_PCB_B);
									LL_LED_ON(E_LL_LED_PCB_G);
									LL_LED_ON(E_LL_LED_PCB_R);
								}else{
									LL_LED_ON(lights[led_num]);
								}
								
									if(0 == LL_GPIO_InputRead(0, 15)){  //RX detect low
											nrf_delay_ms(50);
											if(0 == LL_GPIO_InputRead(0, 15)){
												while(1 != LL_GPIO_InputRead(0, 15));
											}
											nrf_delay_ms(50);
											
											if(led_num == 0){
													LL_LED_OFF(E_LL_LED_PCB_B);
													LL_LED_OFF(E_LL_LED_PCB_G);
													LL_LED_OFF(E_LL_LED_PCB_R);
													led_num+=3;
											}else{
													LL_LED_OFF(  lights[led_num]);
													led_num++;
											}
											
											if(led_num == (sizeof(lights) / sizeof(lights[0])))
											{
												led_num = 0;
											}
											
											
												if(led_num == 0)
												{
													LL_LED_ON(E_LL_LED_PCB_B);
													LL_LED_ON(E_LL_LED_PCB_G);
													LL_LED_ON(E_LL_LED_PCB_R);
												}else{
													LL_LED_ON(lights[led_num]);
												}
																			
										}
									

//                // light one-by-one, 0.5s each
//                for(int i = 0; i < (sizeof(lights) / sizeof(lights[0])); i++) {
//                    // ON 0.5s
//                    LL_LED_ON(  lights[i]); nrf_delay_ms(2000);
//                    // OFF
//                    LL_LED_OFF( lights[i]); 
//                    //
//                    // press button to next testing
//                    if(gatKeyCfg[LL_KEY_NUM_ONOFF].normal != LL_GPIO_InputRead(gatKeyCfg[LL_KEY_NUM_ONOFF].port, gatKeyCfg[LL_KEY_NUM_ONOFF].pin)) goto TESTING_HALL_SENSOR;
//                }
								if(0 == LL_GPIO_InputRead(0, 7))
								{
									nrf_delay_ms(50);
									if( 0 == LL_GPIO_InputRead(0, 7))
									{
											while(0 == LL_GPIO_InputRead(0, 7));
											LL_Power_BeforeSleep(); 
											LL_Power_Sleep();   										
									}
								}
    }



TESTING_HALL_SENSOR:
    // indicate the testing of Hall Sensor
    LL_LED_ON(E_LL_LED_PCB_R);
    LL_LED_ON(E_LL_LED_PCB_G);
    LL_LED_ON(E_LL_LED_PCB_B); //nrf_delay_ms(2000); // delay 2s for user to release the button
    
    E_LL_Buttons tempButton;
    while(1) {
        tempButton = LL_KEY_NUM_HALL_SENSOR_1;
        if(gatKeyCfg[tempButton].normal != LL_GPIO_InputRead(gatKeyCfg[tempButton].port, gatKeyCfg[tempButton].pin)) { LL_LED_ON(E_LL_PWM_RED1); } else { LL_LED_OFF(E_LL_PWM_RED1); }
        tempButton = LL_KEY_NUM_HALL_SENSOR_2;
        if(gatKeyCfg[tempButton].normal != LL_GPIO_InputRead(gatKeyCfg[tempButton].port, gatKeyCfg[tempButton].pin)) { LL_LED_ON(E_LL_PWM_RED2); } else { LL_LED_OFF(E_LL_PWM_RED2); }
       
//        // press button to next
//        tempButton = LL_KEY_NUM_ONOFF;
//        if(gatKeyCfg[tempButton].normal != LL_GPIO_InputRead(gatKeyCfg[tempButton].port, gatKeyCfg[tempButton].pin)) break;
    }
		