Remove Bridge/front end split

as can listen 2 ports can do both together no need to split - so remove
settings and pin
This commit is contained in:
luc lebosse 2015-04-18 19:09:17 +08:00
parent 3d4cf9a065
commit c74d8235dd
3 changed files with 2 additions and 12 deletions

View File

@ -87,7 +87,6 @@ bool CONFIG::reset_config()
if(!CONFIG::write_string(EP_IP_VALUE,DEFAULT_IP_VALUE,strlen(DEFAULT_IP_VALUE)))return false;
if(!CONFIG::write_string(EP_MASK_VALUE,DEFAULT_MASK_VALUE,strlen(DEFAULT_MASK_VALUE)))return false;
if(!CONFIG::write_string(EP_GATEWAY_VALUE,DEFAULT_GATEWAY_VALUE,strlen(DEFAULT_GATEWAY_VALUE)))return false;
if(!CONFIG::write_byte(EP_USAGE_VALUE,DEFAULT_USAGE_MODE))return false;
if(!CONFIG::write_string(EP_BAUD_RATE,DEFAULT_BAUD_RATE,strlen(DEFAULT_BAUD_RATE)))return false;
return true;
}
@ -103,6 +102,5 @@ void CONFIG::print_config()
if (CONFIG::read_string(EP_IP_VALUE, sbuf , MAX_IP_LENGH))Serial.println(sbuf);
if (CONFIG::read_string(EP_MASK_VALUE, sbuf , MAX_IP_LENGH))Serial.println(sbuf);
if (CONFIG::read_string(EP_GATEWAY_VALUE, sbuf , MAX_IP_LENGH))Serial.println(sbuf);
if (CONFIG::read_byte(EP_USAGE_VALUE, &bbuf ))Serial.println(byte(bbuf));
if (CONFIG::read_string(EP_BAUD_RATE, sbuf , MAX_BAUD_LENGH))Serial.println(sbuf);
}

View File

@ -23,8 +23,7 @@
#include <Arduino.h>
//pin used to stop bridge loop
#define INTERRUPT_PIN 2
//pin used to reset setting
#define RESET_CONFIG_PIN 2
//flags
@ -32,9 +31,6 @@
#define CLIENT_MODE 2
#define DHCP_MODE 1
#define STATIC_IP_MODE 2
#define BRIDGE_MODE 1
#define FRONT_END_MODE 2
//position in EEPROM
//AP mode = 1; Station client mode = 2
@ -45,8 +41,7 @@
#define EP_IP_VALUE 100 //17 bytes xxx.xxx.xxx\0 = string
#define EP_MASK_VALUE 117 //17 bytes xxx.xxx.xxx\0 = string
#define EP_GATEWAY_VALUE 134 //17 bytes xxx.xxx.xxx\0 = string
#define EP_USAGE_VALUE 151 //1 byte = flag
#define EP_BAUD_RATE 168 //7 bytes = string (if integer value => save 4 bytes but need to create new interger function for eprom that will take more than 4 bytes)
#define EP_BAUD_RATE 151 //7 bytes = string (if integer value => save 4 bytes but need to create new integer function for eeprom that will take more than 4 bytes)
//default values
#define DEFAULT_WIFI_MODE AP_MODE
@ -56,7 +51,6 @@
#define DEFAULT_IP_VALUE "192.168.0.1"
#define DEFAULT_MASK_VALUE "255.255.255.0"
#define DEFAULT_GATEWAY_VALUE DEFAULT_IP_VALUE
#define DEFAULT_USAGE_MODE BRIDGE_MODE
#define DEFAULT_BAUD_RATE "9600"
#define EEPROM_SIZE 256 //max is 512

View File

@ -50,8 +50,6 @@ void setup() {
//check if reset config is requested
pinMode(RESET_CONFIG_PIN, INPUT);
if (digitalRead(RESET_CONFIG_PIN)==0)breset_config=true;//if requested =>reset settings
//now setup interrupt loop pin for input
pinMode(INTERRUPT_PIN, INPUT);
//default baud rate
word baud_rate;
char sbuf[7];