代码拉取完成,页面将自动刷新
同步操作将从 namelesstech/TIDronePlanner_MSPM0G3507 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "ti_msp_dl_config.h"
#include "sensor.h"
#include "developer_mode.h"
#include "nclink.h"
#include "bsp_eeprom.h"
#include "w25qxx.h"
#include "bsp_led.h"
#include "drv_expand.h"
#include "systick.h"
#include "drv_oled.h"
#include "key.h"
int16_t Page_Number = 0;
#define Page_Number_Max 5
button _button;
float Button_ADCResult[2];
uint16_t adc_value[3] = {0, 0, 0};
uint8_t Key_Value[2];
void Key_Init(void)
{
_button.state[UP].port = keyup_port;
_button.state[UP].pin = keyup_pin;
_button.state[UP].value = 1;
_button.state[UP].last_value = 1;
_button.state[DOWN].port = keydown_port;
_button.state[DOWN].pin = keydown_pin;
_button.state[DOWN].value = 1;
_button.state[DOWN].last_value = 1;
//3D
_button.state[UP_3D].port = PORTB_PORT;
_button.state[UP_3D].pin = PORTB_D3_5_PIN;
_button.state[UP_3D].value = 1;
_button.state[UP_3D].last_value = 1;
_button.state[DN_3D].port = PORTB_PORT;
_button.state[DN_3D].pin = PORTB_D3_1_PIN;
_button.state[DN_3D].value = 1;
_button.state[DN_3D].last_value = 1;
_button.state[LT_3D].port = PORTB_PORT;
_button.state[LT_3D].pin = PORTB_D3_2_PIN;
_button.state[LT_3D].value = 1;
_button.state[LT_3D].last_value = 1;
_button.state[RT_3D].port = PORTB_PORT;
_button.state[RT_3D].pin = PORTB_D3_3_PIN;
_button.state[RT_3D].value = 1;
_button.state[RT_3D].last_value = 1;
_button.state[ME_3D].port = PORTB_PORT;
_button.state[ME_3D].pin = PORTB_D3_4_PIN;
_button.state[ME_3D].value = 1;
_button.state[ME_3D].last_value = 1;
}
void Read_Button_State_One(button_state *button)
{
if(button->pin == KEYA_S2_PIN) button->value = (DL_GPIO_readPins(button->port, button->pin) != 0 ? 0x00 : 0x01);
else button->value = (DL_GPIO_readPins(button->port, button->pin) != 0 ? 0x01 : 0x00);
if(button->value==0)
{
if(button->last_value!=0)//首次按下
{
button->press_time=millis();//记录按下的时间点
button->in_time=millis();//记录按下的时间点
button->in_press_cnt=0;
}
else
{
if(millis()-button->press_time>KEEP_LONG_PRESS_LIMIT)//达到持续长按时间限制,声音提示可以松开了
{
// beep.period=20;//20*5ms
// beep.light_on_percent=0.5f;
// beep.reset=1;
// beep.times=1;
}
else if(millis()-button->in_time>IN_PRESS_LIMIT)//持续按下
{
button->in_time=millis();
button->press=IN_PRESS;
if(button->press==IN_PRESS) button->in_press_cnt++;
}
}
}
else
{
if(button->last_value==0)//按下后释放
{
button->release_time=millis();//记录释放时的时间
if(button->release_time-button->press_time>KEEP_LONG_PRESS_LIMIT)//持续长按按键5S
{
button->press=KEEP_LONG_PRESS;
button->state_lock_time=0;
buzzer_setup(1000,0.5f,4);
}
else if(button->release_time-button->press_time>LONG_PRESS_LIMIT)//长按按键1S
{
button->press=LONG_PRESS;
button->state_lock_time=0;//5ms*300=1.5S
buzzer_setup(1000,0.5f,1);
}
else
{
button->press=SHORT_PRESS;
button->state_lock_time=0;//5ms*300=1.5S
buzzer_setup(100,0.5f,1);
}
}
}
button->last_value=button->value;
if(button->press==LONG_PRESS
||button->press==SHORT_PRESS)//按下释放后,程序后台1.5S内无响应,复位按键状态
{
button->state_lock_time++;
if(button->state_lock_time>=300)
{
button->press=NO_PRESS;
button->state_lock_time=0;
}
}
}
void Read_Button_State_All(void)
{
for(uint16_t i = 0; i < BUTTON_NUM; i++)
{
Read_Button_State_One(&_button.state[i]);
}
}
void key_delay(int32_t period)
{
while(period--)
{
delay_us(1);
}
}
bool Key_Scan(uint8_t release)
{
if(release == 1) return false;
if(_button.state[UP].press == SHORT_PRESS)
{
Page_Number--;
if(Page_Number < 0) Page_Number = Page_Number_Max;
_button.state[UP].press = NO_PRESS;
OLED_CLS();
//buzzer_setup(200, 0.5, 1);
}
if(_button.state[DOWN].press == SHORT_PRESS)
{
Page_Number++;
if(Page_Number > Page_Number_Max) Page_Number = 0;
_button.state[DOWN].press = NO_PRESS;
OLED_CLS();
//buzzer_setup(200, 0.5, 1);
}
return true;
}
extern uint16_t w25qxx_id;
extern systime t_g0;
void oled_page_show(void)
{
switch(Page_Number)
{
case 0:
{
LCD_clear_L(0, 0);
write_6_8_number_f1(0, 0, t_g0.period);
display_6_8_string(30, 0, "SDK:");
display_6_8_number(55, 0, SDK1_Mode_Setup);
display_6_8_string(75, 0, "INC:");
display_6_8_number(105, 0, task_select_cnt);
display_6_8_number(115, 0, Page_Number + 1);
LCD_clear_L(0, 1);
display_6_8_string(0, 1, "Y:");
display_6_8_number(15, 1, uav_ahrs.yaw);
if(uav_ahrs.rpy_gyro_dps[2] < 0) display_6_8_string(55, 1, "-");
else display_6_8_string(55, 1, "+");
display_6_8_number(63, 1, ABS(uav_ahrs.rpy_gyro_dps[2]));
display_6_8_number(105, 1, uav_ahrs.quaternion_init_ok);
LCD_clear_L(0, 2);
display_6_8_string(0, 2, "P:");
display_6_8_number(15, 2, uav_ahrs.pitch);
if(uav_ahrs.rpy_gyro_dps[1] < 0) display_6_8_string(55, 2, "-");
else display_6_8_string(55, 2, "+");
display_6_8_number(63, 2, ABS(uav_ahrs.rpy_gyro_dps[1]));
display_6_8_number(105, 2, current_state.rec_update_flag);
LCD_clear_L(0, 3);
display_6_8_string(0, 3, "R:");
display_6_8_number(15, 3, uav_ahrs.roll);
if(uav_ahrs.rpy_gyro_dps[0] < 0) display_6_8_string(55, 3, "-");
else display_6_8_string(55, 3, "+");
display_6_8_number(63, 3, ABS(uav_ahrs.rpy_gyro_dps[0]));
display_6_8_number(105, 3, offboard_start_flag);
LCD_clear_L(0, 4);
display_6_8_string(0, 4, "EPV:");
write_6_8_number_f1(30, 4, uav_ins.position[_EAST]);
write_6_8_number_f1(60, 4, uav_ins.speed[_EAST]);
LCD_clear_L(0, 5);
display_6_8_string(0, 5, "NPV:");
write_6_8_number_f1(30, 5, uav_ins.position[_NORTH]);
write_6_8_number_f1(60, 5, uav_ins.speed[_NORTH]);
LCD_clear_L(0, 6);
display_6_8_string(0, 6, "UPV:");
write_6_8_number_f1(30, 6, uav_ins.position[_UP]);
write_6_8_number_f1(60, 6, uav_ins.speed[_UP]);
LCD_clear_L(0, 7);
display_6_8_string(0, 7, "AC:");
write_6_8_number_f1(20, 7, uav_ins.accel_cmpss[_EAST]);
write_6_8_number_f1(55, 7, uav_ins.accel_cmpss[_NORTH]);
write_6_8_number_f1(90, 7, uav_ins.accel_cmpss[_UP]);
/***********************************************************************************/
if(_button.state[DN_3D].press == SHORT_PRESS)//下键长按,实现对SDK1_Mode_Setup的调整
{
_button.state[DN_3D].press = NO_PRESS;
SDK1_Mode_Setup++;
if(SDK1_Mode_Setup > SDK_MODE_VALID_MAX) SDK1_Mode_Setup = 0;
WriteFlashParameter(SDK1_MODE_DEFAULT, SDK1_Mode_Setup);
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0);//蓝色
}
if(_button.state[UP_3D].press == SHORT_PRESS)//上按键长按,实现对SDK1_Mode_Setup的调整
{
_button.state[UP_3D].press = NO_PRESS;
SDK1_Mode_Setup--;
if(SDK1_Mode_Setup < 0) SDK1_Mode_Setup = SDK_MODE_VALID_MAX;
WriteFlashParameter(SDK1_MODE_DEFAULT, SDK1_Mode_Setup);
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0);//蓝色
}
/***********************************************************************************/
if(_button.state[RT_3D].press==SHORT_PRESS)//3D右键短按,实现对task_select_cnt的调整
{
_button.state[RT_3D].press=NO_PRESS;
task_select_cnt++;
if(task_select_cnt>5) task_select_cnt=0;
WriteFlashParameter(TASK_SELECT_AFTER_TAKEOFF,task_select_cnt);
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0);//蓝色
}
if(_button.state[LT_3D].press==SHORT_PRESS)//3D左键短按,实现对task_select_cnt的调整
{
_button.state[LT_3D].press=NO_PRESS;
task_select_cnt--;
if(task_select_cnt<0) task_select_cnt=5;
WriteFlashParameter(TASK_SELECT_AFTER_TAKEOFF,task_select_cnt);
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0);//蓝色
}
/***********************************************************************************/
if(_button.state[ME_3D].press == LONG_PRESS)
{
_button.state[ME_3D].press = NO_PRESS;
AT24CXX_Erase_All();//清空eeprom
w25qxx_erase_all(); //清空flash
}
};
break;
case 1:
{
uint16_t base_item = 50;
LCD_clear_L(0, 0);
display_6_8_string(0, 0, "nav_point:1/7 e-n-u");
write_6_8_number(115, 0, Page_Number + 1);
LCD_clear_L(0, 1);
display_6_8_string(0, 1, "p1");
write_6_8_number(25, 1, param_value[base_item + 0]);
write_6_8_number(60, 1, param_value[base_item + 1]);
write_6_8_number(95, 1, param_value[base_item + 2]);
LCD_clear_L(0, 2);
display_6_8_string(0, 2, "p2");
write_6_8_number(25, 2, param_value[base_item + 3]);
write_6_8_number(60, 2, param_value[base_item + 4]);
write_6_8_number(95, 2, param_value[base_item + 5]);
LCD_clear_L(0, 3);
display_6_8_string(0, 3, "p3");
write_6_8_number(25, 3, param_value[base_item + 6]);
write_6_8_number(60, 3, param_value[base_item + 7]);
write_6_8_number(95, 3, param_value[base_item + 8]);
LCD_clear_L(0, 4);
display_6_8_string(0, 4, "p4");
write_6_8_number(25, 4, param_value[base_item + 9]);
write_6_8_number(60, 4, param_value[base_item + 10]);
write_6_8_number(95, 4, param_value[base_item + 11]);
LCD_clear_L(0, 5);
display_6_8_string(0, 5, "p5");
write_6_8_number(25, 5, param_value[base_item + 12]);
write_6_8_number(60, 5, param_value[base_item + 13]);
write_6_8_number(95, 5, param_value[base_item + 14]);
LCD_clear_L(0, 6);
display_6_8_string(0, 6, "p6");
write_6_8_number(25, 6, param_value[base_item + 15]);
write_6_8_number(60, 6, param_value[base_item + 16]);
write_6_8_number(95, 6, param_value[base_item + 17]);
LCD_clear_L(0, 7);
display_6_8_string(0, 7, "p7");
write_6_8_number(25, 7, param_value[base_item + 18]);
write_6_8_number(60, 7, param_value[base_item + 19]);
write_6_8_number(95, 7, param_value[base_item + 20]);
static uint16_t ver_item = 1;
if(ver_item == 1) display_6_8_string(18, 1, "*");
else if(ver_item == 2) display_6_8_string(53, 1, "*");
else if(ver_item == 3) display_6_8_string(88, 1, "*");
if(ver_item == 4) display_6_8_string(18, 2, "*");
else if(ver_item == 5) display_6_8_string(53, 2, "*");
else if(ver_item == 6) display_6_8_string(88, 2, "*");
if(ver_item == 7) display_6_8_string(18, 3, "*");
else if(ver_item == 8) display_6_8_string(53, 3, "*");
else if(ver_item == 9) display_6_8_string(88, 3, "*");
if(ver_item == 10) display_6_8_string(18, 4, "*");
else if(ver_item == 11) display_6_8_string(53, 4, "*");
else if(ver_item == 12) display_6_8_string(88, 4, "*");
if(ver_item == 13) display_6_8_string(18, 5, "*");
else if(ver_item == 14) display_6_8_string(53, 5, "*");
else if(ver_item == 15) display_6_8_string(88, 5, "*");
if(ver_item == 16) display_6_8_string(18, 6, "*");
else if(ver_item == 17) display_6_8_string(53, 6, "*");
else if(ver_item == 18) display_6_8_string(88, 6, "*");
if(ver_item == 19) display_6_8_string(18, 7, "*");
else if(ver_item == 20) display_6_8_string(53, 7, "*");
else if(ver_item == 21) display_6_8_string(88, 7, "*");
//通过3D按键来实现换行选中待修改参数
if(_button.state[UP_3D].press == SHORT_PRESS)
{
_button.state[UP_3D].press = NO_PRESS;
ver_item--;
if(ver_item < 1) ver_item = 21;
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0); //蓝色
}
if(_button.state[DN_3D].press == SHORT_PRESS)
{
_button.state[DN_3D].press = NO_PRESS;
ver_item++;
if(ver_item > 21) ver_item = 1;
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0); //蓝色
}
//通过左按键短按可以实现选中的参数行自减小1调整
if(_button.state[LT_3D].press == SHORT_PRESS)
{
_button.state[LT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] -= 1;
}
//通过右按键短按可以实现选中的参数行自增加1调整
if(_button.state[RT_3D].press == SHORT_PRESS)
{
_button.state[RT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] += 1;
}
//通过左按键短按可以实现选中的参数行自减小50调整
if(_button.state[LT_3D].press == LONG_PRESS)
{
_button.state[LT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] -= 50;
}
//通过右按键短按可以实现选中的参数行自增加50调整
if(_button.state[RT_3D].press == LONG_PRESS)
{
_button.state[RT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] += 50;
}
//通过中间按键长按可以实现此页设置的所有参数保存
if(_button.state[ME_3D].press == LONG_PRESS)
{
_button.state[ME_3D].press = NO_PRESS;
//按下后对参数进行保存
for(uint16_t i = 0; i < 21; i++)
{
WriteFlashParameter(RESERVED_PARAM + base_item + i, param_value[base_item + i]);
}
}
}
break;
case 2:
{
uint16_t base_item = 50 + 21 * 1;
LCD_clear_L(0, 0);
display_6_8_string(0, 0, "nav_point:8/14 e-n-u");
write_6_8_number(115, 0, Page_Number + 1);
LCD_clear_L(0, 1);
display_6_8_string(0, 1, "p8");
write_6_8_number(25, 1, param_value[base_item + 0]);
write_6_8_number(60, 1, param_value[base_item + 1]);
write_6_8_number(95, 1, param_value[base_item + 2]);
LCD_clear_L(0, 2);
display_6_8_string(0, 2, "p9");
write_6_8_number(25, 2, param_value[base_item + 3]);
write_6_8_number(60, 2, param_value[base_item + 4]);
write_6_8_number(95, 2, param_value[base_item + 5]);
LCD_clear_L(0, 3);
display_6_8_string(0, 3, "p10");
write_6_8_number(25, 3, param_value[base_item + 6]);
write_6_8_number(60, 3, param_value[base_item + 7]);
write_6_8_number(95, 3, param_value[base_item + 8]);
LCD_clear_L(0, 4);
display_6_8_string(0, 4, "p11");
write_6_8_number(25, 4, param_value[base_item + 9]);
write_6_8_number(60, 4, param_value[base_item + 10]);
write_6_8_number(95, 4, param_value[base_item + 11]);
LCD_clear_L(0, 5);
display_6_8_string(0, 5, "p12");
write_6_8_number(25, 5, param_value[base_item + 12]);
write_6_8_number(60, 5, param_value[base_item + 13]);
write_6_8_number(95, 5, param_value[base_item + 14]);
LCD_clear_L(0, 6);
display_6_8_string(0, 6, "p13");
write_6_8_number(25, 6, param_value[base_item + 15]);
write_6_8_number(60, 6, param_value[base_item + 16]);
write_6_8_number(95, 6, param_value[base_item + 17]);
LCD_clear_L(0, 7);
display_6_8_string(0, 7, "p14");
write_6_8_number(25, 7, param_value[base_item + 18]);
write_6_8_number(60, 7, param_value[base_item + 19]);
write_6_8_number(95, 7, param_value[base_item + 20]);
static uint16_t ver_item = 1;
if(ver_item == 1) display_6_8_string(18, 1, "*");
else if(ver_item == 2) display_6_8_string(53, 1, "*");
else if(ver_item == 3) display_6_8_string(88, 1, "*");
if(ver_item == 4) display_6_8_string(18, 2, "*");
else if(ver_item == 5) display_6_8_string(53, 2, "*");
else if(ver_item == 6) display_6_8_string(88, 2, "*");
if(ver_item == 7) display_6_8_string(18, 3, "*");
else if(ver_item == 8) display_6_8_string(53, 3, "*");
else if(ver_item == 9) display_6_8_string(88, 3, "*");
if(ver_item == 10) display_6_8_string(18, 4, "*");
else if(ver_item == 11) display_6_8_string(53, 4, "*");
else if(ver_item == 12) display_6_8_string(88, 4, "*");
if(ver_item == 13) display_6_8_string(18, 5, "*");
else if(ver_item == 14) display_6_8_string(53, 5, "*");
else if(ver_item == 15) display_6_8_string(88, 5, "*");
if(ver_item == 16) display_6_8_string(18, 6, "*");
else if(ver_item == 17) display_6_8_string(53, 6, "*");
else if(ver_item == 18) display_6_8_string(88, 6, "*");
if(ver_item == 19) display_6_8_string(18, 7, "*");
else if(ver_item == 20) display_6_8_string(53, 7, "*");
else if(ver_item == 21) display_6_8_string(88, 7, "*");
//通过3D按键来实现换行选中待修改参数
if(_button.state[UP_3D].press == SHORT_PRESS)
{
_button.state[UP_3D].press = NO_PRESS;
ver_item--;
if(ver_item < 1) ver_item = 21;
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0); //蓝色
Bling_Set(&Light_Blue, 500, 50, 0.2, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0); //蓝色
}
if(_button.state[DN_3D].press == SHORT_PRESS)
{
_button.state[DN_3D].press = NO_PRESS;
ver_item++;
if(ver_item > 21) ver_item = 1;
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0); //蓝色
}
//通过左按键短按可以实现选中的参数行自减小1调整
if(_button.state[LT_3D].press == SHORT_PRESS)
{
_button.state[LT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] -= 1;
}
//通过右按键短按可以实现选中的参数行自增加1调整
if(_button.state[RT_3D].press == SHORT_PRESS)
{
_button.state[RT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] += 1;
}
//通过左按键短按可以实现选中的参数行自减小50调整
if(_button.state[LT_3D].press == LONG_PRESS)
{
_button.state[LT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] -= 50;
}
//通过右按键短按可以实现选中的参数行自增加50调整
if(_button.state[RT_3D].press == LONG_PRESS)
{
_button.state[RT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] += 50;
}
//通过中间按键长按可以实现此页设置的所有参数保存
if(_button.state[ME_3D].press == LONG_PRESS)
{
_button.state[ME_3D].press = NO_PRESS;
//按下后对参数进行保存
for(uint16_t i = 0; i < 21; i++)
{
WriteFlashParameter(RESERVED_PARAM + base_item + i, param_value[base_item + i]);
}
}
}
break;
case 3:
{
uint16_t base_item = 50 + 21 * 2;
LCD_clear_L(0, 0);
display_6_8_string(0, 0, "nav_point:15/21 e-n-u");
write_6_8_number(115, 0, Page_Number + 1);
LCD_clear_L(0, 1);
display_6_8_string(0, 1, "p15");
write_6_8_number(25, 1, param_value[base_item + 0]);
write_6_8_number(60, 1, param_value[base_item + 1]);
write_6_8_number(95, 1, param_value[base_item + 2]);
LCD_clear_L(0, 2);
display_6_8_string(0, 2, "p16");
write_6_8_number(25, 2, param_value[base_item + 3]);
write_6_8_number(60, 2, param_value[base_item + 4]);
write_6_8_number(95, 2, param_value[base_item + 5]);
LCD_clear_L(0, 3);
display_6_8_string(0, 3, "p17");
write_6_8_number(25, 3, param_value[base_item + 6]);
write_6_8_number(60, 3, param_value[base_item + 7]);
write_6_8_number(95, 3, param_value[base_item + 8]);
LCD_clear_L(0, 4);
display_6_8_string(0, 4, "p18");
write_6_8_number(25, 4, param_value[base_item + 9]);
write_6_8_number(60, 4, param_value[base_item + 10]);
write_6_8_number(95, 4, param_value[base_item + 11]);
LCD_clear_L(0, 5);
display_6_8_string(0, 5, "p19");
write_6_8_number(25, 5, param_value[base_item + 12]);
write_6_8_number(60, 5, param_value[base_item + 13]);
write_6_8_number(95, 5, param_value[base_item + 14]);
LCD_clear_L(0, 6);
display_6_8_string(0, 6, "p20");
write_6_8_number(25, 6, param_value[base_item + 15]);
write_6_8_number(60, 6, param_value[base_item + 16]);
write_6_8_number(95, 6, param_value[base_item + 17]);
LCD_clear_L(0, 7);
display_6_8_string(0, 7, "p21");
write_6_8_number(25, 7, param_value[base_item + 18]);
write_6_8_number(60, 7, param_value[base_item + 19]);
write_6_8_number(95, 7, param_value[base_item + 20]);
static uint16_t ver_item = 1;
if(ver_item == 1) display_6_8_string(18, 1, "*");
else if(ver_item == 2) display_6_8_string(53, 1, "*");
else if(ver_item == 3) display_6_8_string(88, 1, "*");
if(ver_item == 4) display_6_8_string(18, 2, "*");
else if(ver_item == 5) display_6_8_string(53, 2, "*");
else if(ver_item == 6) display_6_8_string(88, 2, "*");
if(ver_item == 7) display_6_8_string(18, 3, "*");
else if(ver_item == 8) display_6_8_string(53, 3, "*");
else if(ver_item == 9) display_6_8_string(88, 3, "*");
if(ver_item == 10) display_6_8_string(18, 4, "*");
else if(ver_item == 11) display_6_8_string(53, 4, "*");
else if(ver_item == 12) display_6_8_string(88, 4, "*");
if(ver_item == 13) display_6_8_string(18, 5, "*");
else if(ver_item == 14) display_6_8_string(53, 5, "*");
else if(ver_item == 15) display_6_8_string(88, 5, "*");
if(ver_item == 16) display_6_8_string(18, 6, "*");
else if(ver_item == 17) display_6_8_string(53, 6, "*");
else if(ver_item == 18) display_6_8_string(88, 6, "*");
if(ver_item == 19) display_6_8_string(18, 7, "*");
else if(ver_item == 20) display_6_8_string(53, 7, "*");
else if(ver_item == 21) display_6_8_string(88, 7, "*");
//通过3D按键来实现换行选中待修改参数
if(_button.state[UP_3D].press == SHORT_PRESS)
{
_button.state[UP_3D].press = NO_PRESS;
ver_item--;
if(ver_item < 1) ver_item = 21;
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0); //蓝色
}
if(_button.state[DN_3D].press == SHORT_PRESS)
{
_button.state[DN_3D].press = NO_PRESS;
ver_item++;
if(ver_item > 21) ver_item = 1;
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0);//蓝色
}
//通过左按键短按可以实现选中的参数行自减小1调整
if(_button.state[LT_3D].press == SHORT_PRESS)
{
_button.state[LT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] -= 1;
}
//通过右按键短按可以实现选中的参数行自增加1调整
if(_button.state[RT_3D].press == SHORT_PRESS)
{
_button.state[RT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] += 1;
}
//通过左按键短按可以实现选中的参数行自减小50调整
if(_button.state[LT_3D].press == LONG_PRESS)
{
_button.state[LT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] -= 50;
}
//通过右按键短按可以实现选中的参数行自增加50调整
if(_button.state[RT_3D].press == LONG_PRESS)
{
_button.state[RT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] += 50;
}
//通过中间按键长按可以实现此页设置的所有参数保存
if(_button.state[ME_3D].press == LONG_PRESS)
{
_button.state[ME_3D].press = NO_PRESS;
//按下后对参数进行保存
for(uint16_t i = 0; i < 21; i++)
{
WriteFlashParameter(RESERVED_PARAM + base_item + i, param_value[base_item + i]);
}
}
}
break;
case 4:
{
uint16_t base_item = 50 + 21 * 3;
LCD_clear_L(0, 0);
display_6_8_string(0, 0, "nav_point:22/28 e-n-u");
write_6_8_number(115, 0, Page_Number + 1);
LCD_clear_L(0, 1);
display_6_8_string(0, 1, "p22");
write_6_8_number(25, 1, param_value[base_item + 0]);
write_6_8_number(60, 1, param_value[base_item + 1]);
write_6_8_number(95, 1, param_value[base_item + 2]);
LCD_clear_L(0, 2);
display_6_8_string(0, 2, "p23");
write_6_8_number(25, 2, param_value[base_item + 3]);
write_6_8_number(60, 2, param_value[base_item + 4]);
write_6_8_number(95, 2, param_value[base_item + 5]);
LCD_clear_L(0, 3);
display_6_8_string(0, 3, "p24");
write_6_8_number(25, 3, param_value[base_item + 6]);
write_6_8_number(60, 3, param_value[base_item + 7]);
write_6_8_number(95, 3, param_value[base_item + 8]);
LCD_clear_L(0, 4);
display_6_8_string(0, 4, "p25");
write_6_8_number(25, 4, param_value[base_item + 9]);
write_6_8_number(60, 4, param_value[base_item + 10]);
write_6_8_number(95, 4, param_value[base_item + 11]);
LCD_clear_L(0, 5);
display_6_8_string(0, 5, "p26");
write_6_8_number(25, 5, param_value[base_item + 12]);
write_6_8_number(60, 5, param_value[base_item + 13]);
write_6_8_number(95, 5, param_value[base_item + 14]);
LCD_clear_L(0, 6);
display_6_8_string(0, 6, "p27");
write_6_8_number(25, 6, param_value[base_item + 15]);
write_6_8_number(60, 6, param_value[base_item + 16]);
write_6_8_number(95, 6, param_value[base_item + 17]);
LCD_clear_L(0, 7);
display_6_8_string(0, 7, "p28");
write_6_8_number(25, 7, param_value[base_item + 18]);
write_6_8_number(60, 7, param_value[base_item + 19]);
write_6_8_number(95, 7, param_value[base_item + 20]);
static uint16_t ver_item = 1;
if(ver_item == 1) display_6_8_string(18, 1, "*");
else if(ver_item == 2) display_6_8_string(53, 1, "*");
else if(ver_item == 3) display_6_8_string(88, 1, "*");
if(ver_item == 4) display_6_8_string(18, 2, "*");
else if(ver_item == 5) display_6_8_string(53, 2, "*");
else if(ver_item == 6) display_6_8_string(88, 2, "*");
if(ver_item == 7) display_6_8_string(18, 3, "*");
else if(ver_item == 8) display_6_8_string(53, 3, "*");
else if(ver_item == 9) display_6_8_string(88, 3, "*");
if(ver_item == 10) display_6_8_string(18, 4, "*");
else if(ver_item == 11) display_6_8_string(53, 4, "*");
else if(ver_item == 12) display_6_8_string(88, 4, "*");
if(ver_item == 13) display_6_8_string(18, 5, "*");
else if(ver_item == 14) display_6_8_string(53, 5, "*");
else if(ver_item == 15) display_6_8_string(88, 5, "*");
if(ver_item == 16) display_6_8_string(18, 6, "*");
else if(ver_item == 17) display_6_8_string(53, 6, "*");
else if(ver_item == 18) display_6_8_string(88, 6, "*");
if(ver_item == 19) display_6_8_string(18, 7, "*");
else if(ver_item == 20) display_6_8_string(53, 7, "*");
else if(ver_item == 21) display_6_8_string(88, 7, "*");
//通过3D按键来实现换行选中待修改参数
if(_button.state[UP_3D].press == SHORT_PRESS)
{
_button.state[UP_3D].press = NO_PRESS;
ver_item--;
if(ver_item < 1) ver_item = 21;
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0); //蓝色
}
if(_button.state[DN_3D].press == SHORT_PRESS)
{
_button.state[DN_3D].press = NO_PRESS;
ver_item++;
if(ver_item > 21) ver_item = 1;
Bling_Set(&Light_Blue, 500, 50, 0.5, 0, BLING_B_PORT, GPIO_RGB_BLUE_PIN, 0); //蓝色
}
//通过左按键短按可以实现选中的参数行自减小1调整
if(_button.state[LT_3D].press == SHORT_PRESS)
{
_button.state[LT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] -= 1;
}
//通过右按键短按可以实现选中的参数行自增加1调整
if(_button.state[RT_3D].press == SHORT_PRESS)
{
_button.state[RT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] += 1;
}
//通过左按键短按可以实现选中的参数行自减小50调整
if(_button.state[LT_3D].press == LONG_PRESS)
{
_button.state[LT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] -= 50;
}
//通过右按键短按可以实现选中的参数行自增加50调整
if(_button.state[RT_3D].press == LONG_PRESS)
{
_button.state[RT_3D].press = NO_PRESS;
param_value[base_item + ver_item - 1] += 50;
}
//通过中间按键长按可以实现此页设置的所有参数保存
if(_button.state[ME_3D].press == LONG_PRESS)
{
_button.state[ME_3D].press = NO_PRESS;
//按下后对参数进行保存
for(uint16_t i = 0; i < 21; i++)
{
WriteFlashParameter(RESERVED_PARAM + base_item + i, param_value[base_item + i]);
}
}
}
break;
default://空白页面提示,提醒用户保持镇定
{
LCD_clear_L(0, 0);
display_6_8_string(0, 0, "Reserved Show Page:");
write_6_8_number(115, 0, Page_Number + 1);
LCD_clear_L(0, 2);
display_6_8_string(0, 2, " Don't Worry ");
LCD_clear_L(0, 4);
display_6_8_string(0, 4, " Continue Press To");
LCD_clear_L(0, 6);
display_6_8_string(0, 6, " Page Up/Down");
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。