Standardize on uart0-tx-enable variable name on the HTML side (thanks @krzy27)

pull/138/head
Alastair D'Silva 9 years ago
parent 92411f0d76
commit c49d207213
  1. 3
      esp-link/cgipins.c
  2. 5
      esp-link/config.c
  3. 6
      html/ui.js

@ -57,7 +57,7 @@ int ICACHE_FLASH_ATTR cgiPinsSet(HttpdConnData *connData) {
ok |= getInt8Arg(connData, "ser", &ser);
ok |= getBoolArg(connData, "swap", &swap);
ok |= getBoolArg(connData, "rxpup", &rxpup);
ok |= getInt8Arg(connData, "uart0_tx_enable", &uart0_tx_enable);
ok |= getInt8Arg(connData, "uart0-tx-enable", &uart0_tx_enable);
if (ok < 0) return HTTPD_CGI_DONE;
char *coll;
@ -96,6 +96,7 @@ int ICACHE_FLASH_ATTR cgiPinsSet(HttpdConnData *connData) {
flashConfig.ser_led_pin = ser;
flashConfig.swap_uart = swap;
flashConfig.rx_pullup = rxpup;
flashConfig.uart0_tx_enable_pin = uart0_tx_enable;
os_printf("Pins changed: reset=%d isp=%d conn=%d ser=%d swap=%d rx-pup=%d uart0_tx_enable=%d\n",
reset, isp, conn, ser, swap, rxpup, uart0_tx_enable);

@ -134,7 +134,7 @@ bool ICACHE_FLASH_ATTR configRestore(void) {
char hostname[16];
os_strcpy(hostname, "esp-link-");
os_strcat(hostname, chipIdStr);
os_memcpy(&flashConfig.hostname, hostname, os_strlen(hostname));
os_memcpy(&flashConfig.hostname, hostname, os_strlen(hostname));u
#endif
os_memcpy(&flashConfig.mqtt_clientid, &flashConfig.hostname, os_strlen(flashConfig.hostname));
os_memcpy(&flashConfig.mqtt_status_topic, &flashConfig.hostname, os_strlen(flashConfig.hostname));
@ -186,3 +186,6 @@ getFlashSize() {
return 0;
return 1 << size_id;
}

@ -393,7 +393,7 @@ function showNotification(text) {
//===== GPIO Pin mux card
var pinPresets = {
// array: reset, isp, conn, ser, swap, rxpup, uart0_tx_enable
// array: reset, isp, conn, ser, swap, rxpup, uart0-tx-enable
"esp-01": [ 0, -1, 2, -1, 0, 1, -1 ],
"esp-12": [ 12, 14, 0, 2, 0, 1, -1 ],
"esp-12 swap": [ 1, 3, 0, 2, 1, 1, -1 ],
@ -454,7 +454,7 @@ function displayPins(resp) {
createSelectForPin("ser", resp["ser"]);
$("#pin-swap").value = resp["swap"];
$("#pin-rxpup").checked = !!resp["rxpup"];
createSelectForPin("uart0_tx_enable", resp["uart0_tx_enable"]);
createSelectForPin("uart0-tx-enable", resp["uart0-tx-enable"]);
createPresets($("#pin-preset"));
$("#pin-spinner").setAttribute("hidden", "");
@ -471,7 +471,7 @@ function setPins(ev) {
ev.preventDefault();
var url = "/pins";
var sep = "?";
["reset", "isp", "conn", "ser", "swap", "uart0_tx_enable"].forEach(function(p) {
["reset", "isp", "conn", "ser", "swap", "uart0-tx-enable"].forEach(function(p) {
url += sep + p + "=" + $("#pin-"+p).value;
sep = "&";
});

Loading…
Cancel
Save