Add 250000 baud rate support

as arduino IDE support it
This commit is contained in:
Luc 2015-07-24 23:49:26 +08:00
parent 93333ef96c
commit c9c41cb3ad
2 changed files with 6 additions and 2 deletions

View File

@ -62,7 +62,7 @@ void setup() {
if ( CONFIG::read_buffer(EP_BAUD_RATE, (byte *)&baud_rate , INTEGER_LENGH)&&CONFIG::read_buffer(EP_WEB_PORT, (byte *)&(wifi_config.iweb_port) , INTEGER_LENGH)&&CONFIG::read_buffer(EP_DATA_PORT, (byte *)&(wifi_config.idata_port) , INTEGER_LENGH)) if ( CONFIG::read_buffer(EP_BAUD_RATE, (byte *)&baud_rate , INTEGER_LENGH)&&CONFIG::read_buffer(EP_WEB_PORT, (byte *)&(wifi_config.iweb_port) , INTEGER_LENGH)&&CONFIG::read_buffer(EP_DATA_PORT, (byte *)&(wifi_config.idata_port) , INTEGER_LENGH))
{ {
//check if baud value is one of allowed ones //check if baud value is one of allowed ones
if ( ! (baud_rate==9600 || baud_rate==19200 ||baud_rate==38400 ||baud_rate==57600 ||baud_rate==115200 ||baud_rate==230400) )breset_config=true;//baud rate is incorrect =>reset settings if ( ! (baud_rate==9600 || baud_rate==19200 ||baud_rate==38400 ||baud_rate==57600 ||baud_rate==115200 ||baud_rate==230400 ||baud_rate==250000) )breset_config=true;//baud rate is incorrect =>reset settings
if (wifi_config.iweb_port<1 ||wifi_config.iweb_port>65001 || wifi_config.idata_port <1 || wifi_config.idata_port >65001)breset_config=true; //out of range =>reset settings if (wifi_config.iweb_port<1 ||wifi_config.iweb_port>65001 || wifi_config.idata_port <1 || wifi_config.idata_port >65001)breset_config=true; //out of range =>reset settings
} }

View File

@ -193,6 +193,7 @@ const char VALUE_38400[] PROGMEM = "38400";
const char VALUE_57600[] PROGMEM = "57600"; const char VALUE_57600[] PROGMEM = "57600";
const char VALUE_115200[] PROGMEM = "115200"; const char VALUE_115200[] PROGMEM = "115200";
const char VALUE_230400[] PROGMEM = "230400"; const char VALUE_230400[] PROGMEM = "230400";
const char VALUE_250000[] PROGMEM = "250000";
const char VALUE_SELECTED[] PROGMEM = "selected"; const char VALUE_SELECTED[] PROGMEM = "selected";
const char AP_1_ID[] PROGMEM = "AP1"; const char AP_1_ID[] PROGMEM = "AP1";
const char AP_2_ID[] PROGMEM = "AP2"; const char AP_2_ID[] PROGMEM = "AP2";
@ -600,7 +601,7 @@ void handle_web_interface_configSys()
msg_alert_error=true; msg_alert_error=true;
smsg=PROGMEM2CHAR(ERROR_INCORRECT_PORT2); smsg=PROGMEM2CHAR(ERROR_INCORRECT_PORT2);
} }
if (!(ibaud==9600 || ibaud==19200|| ibaud==38400|| ibaud==57600|| ibaud==115200|| ibaud==230400) || if (!(ibaud==9600 || ibaud==19200|| ibaud==38400|| ibaud==57600|| ibaud==115200|| ibaud==230400 || ibaud==250000) ||
!(bsleepmode==NONE_SLEEP_T ||bsleepmode==LIGHT_SLEEP_T ||bsleepmode==MODEM_SLEEP_T )|| !(bsleepmode==NONE_SLEEP_T ||bsleepmode==LIGHT_SLEEP_T ||bsleepmode==MODEM_SLEEP_T )||
!(polling_time==1 || polling_time==2 ||polling_time==3 || polling_time==4 ||polling_time==5 ||polling_time==10 ||polling_time==30 ||polling_time==60)) !(polling_time==1 || polling_time==2 ||polling_time==3 || polling_time==4 ||polling_time==5 ||polling_time==10 ||polling_time==30 ||polling_time==60))
{ {
@ -674,6 +675,9 @@ void handle_web_interface_configSys()
if (ibaud==230400)stmp = PROGMEM2CHAR(VALUE_SELECTED); if (ibaud==230400)stmp = PROGMEM2CHAR(VALUE_SELECTED);
else stmp=""; else stmp="";
OPTION(PROGMEM2CHAR(VALUE_230400), stmp.c_str(),PROGMEM2CHAR(VALUE_230400)) OPTION(PROGMEM2CHAR(VALUE_230400), stmp.c_str(),PROGMEM2CHAR(VALUE_230400))
if (ibaud==250000)stmp = PROGMEM2CHAR(VALUE_SELECTED);
else stmp="";
OPTION(PROGMEM2CHAR(VALUE_250000), stmp.c_str(),PROGMEM2CHAR(VALUE_250000))
SELECT_END SELECT_END
// buffer2send+=(PROGMEM2CHAR(BR)); // buffer2send+=(PROGMEM2CHAR(BR));