コード例 #1
0
ファイル: cgiprop.c プロジェクト: ParaBump/Parallax-ESP
static void ICACHE_FLASH_ATTR finishLoading(PropellerConnection *connection)
{
    if (connection->finalBaudRate != connection->baudRate);
        uart0_config(connection->finalBaudRate, flashConfig.stop_bits);
    programmingCB = NULL;
    myConnection.state = stIdle;
}
コード例 #2
0
ファイル: console.c プロジェクト: jeelabs/esp-link
int ICACHE_FLASH_ATTR
ajaxConsoleFormat(HttpdConnData *connData) {
  if (connData->conn==NULL) return HTTPD_CGI_DONE; // Connection aborted. Clean up.
  char buff[16];
  int len, status = 400;

  len = httpdFindArg(connData->getArgs, "fmt", buff, sizeof(buff));
  if (len >= 3) {
    int c = buff[0];
    if (c >= '5' && c <= '8') flashConfig.data_bits = c - '5' + FIVE_BITS;
    if (buff[1] == 'N') flashConfig.parity = NONE_BITS;
    if (buff[1] == 'E') flashConfig.parity = EVEN_BITS;
    if (buff[1] == 'O') flashConfig.parity = ODD_BITS;
    if (buff[2] == '1') flashConfig.stop_bits = ONE_STOP_BIT;
    if (buff[2] == '2') flashConfig.stop_bits = TWO_STOP_BIT;
    uart0_config(flashConfig.data_bits, flashConfig.parity, flashConfig.stop_bits);
    status = configSave() ? 200 : 400;
  } else if (connData->requestType == HTTPD_METHOD_GET) {
    status = 200;
  }

  jsonHeader(connData, status);
  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;
}
コード例 #3
0
ファイル: cgiprop.c プロジェクト: ParaBump/Parallax-ESP
static void ICACHE_FLASH_ATTR startLoading(PropellerConnection *connection, const uint8_t *image, int imageSize)
{
    connection->image = image;
    connection->imageSize = imageSize;
    
    // turn off SSCP during loading
    sscp_enable(0);

    uart0_config(connection->baudRate, ONE_STOP_BIT);

    GPIO_OUTPUT_SET(connection->resetPin, 0);
    armTimer(connection, RESET_DELAY_1);
    connection->state = stReset;
}