fix serial LED, fixes #199

pull/213/head
Thorsten von Eicken 8 years ago
parent 64fb2323c3
commit 3cb55b5648
No known key found for this signature in database
GPG Key ID: C7F972A59D834B46
  1. 9
      serial/console.c
  2. 4
      serial/serbridge.c
  3. 1
      serial/serled.c

@ -5,6 +5,7 @@
#include "cgi.h"
#include "uart.h"
#include "serbridge.h"
#include "serled.h"
#include "config.h"
#include "console.h"
@ -80,6 +81,7 @@ ajaxConsoleBaud(HttpdConnData *connData) {
httpdSend(connData, buff, -1);
return HTTPD_CGI_DONE;
}
int ICACHE_FLASH_ATTR
ajaxConsoleFormat(HttpdConnData *connData) {
if (connData->conn==NULL) return HTTPD_CGI_DONE; // Connection aborted. Clean up.
@ -104,10 +106,8 @@ ajaxConsoleFormat(HttpdConnData *connData) {
}
jsonHeader(connData, status);
os_sprintf(buff, "{\"fmt\": \"%c%c%c\"}",
flashConfig.data_bits + '5',
flashConfig.parity ? 'E' : 'N',
flashConfig.stop_bits ? '2': '1');
os_sprintf(buff, "{\"fmt\": \"%c%c%c\"}", flashConfig.data_bits + '5',
flashConfig.parity ? 'E' : 'N', flashConfig.stop_bits ? '2': '1');
httpdSend(connData, buff, -1);
return HTTPD_CGI_DONE;
}
@ -122,6 +122,7 @@ ajaxConsoleSend(HttpdConnData *connData) {
// figure out where to start in buffer based on URI param
len = httpdFindArg(connData->getArgs, "text", buff, sizeof(buff));
if (len > 0) {
serledFlash(50); // short blink on serial LED
uart0_tx_buffer(buff, len);
status = 200;
}

@ -16,8 +16,6 @@
#define syslog(X1...)
#endif
#define SKIP_AT_RESET
static struct espconn serbridgeConn1; // plain bridging port
static struct espconn serbridgeConn2; // programming port
static esp_tcp serbridgeTcp1, serbridgeTcp2;
@ -223,10 +221,8 @@ serbridgeRecvCb(void *arg, char *data, unsigned short len)
os_delay_us(1000L); // wait a millisecond before writing to the UART below
conn->conn_mode = cmPGM;
in_mcu_flashing++; // disable SLIP so it doesn't interfere with flashing
#ifdef SKIP_AT_RESET
serledFlash(50); // short blink on serial LED
return;
#endif
}

@ -29,7 +29,6 @@ void ICACHE_FLASH_ATTR serledFlash(int duration) {
}
void ICACHE_FLASH_ATTR serledInit(void) {
return;
int8_t pin = flashConfig.ser_led_pin;
if (pin >= 0) {
makeGpio(pin);

Loading…
Cancel
Save