Browse Source

Fix PWM WDT resets by increasing period and chaning back to TIMER1 interrupts

fastled
Xose Pérez 6 years ago
parent
commit
67b8c9a23a
12 changed files with 13 additions and 15 deletions
  1. +1
    -5
      code/espurna/config/general.h
  2. +2
    -0
      code/espurna/config/hardware.h
  3. +0
    -0
      code/espurna/libs/MedianFilter.h
  4. +0
    -0
      code/espurna/libs/StreamInjector.h
  5. +0
    -0
      code/espurna/libs/WebSocketIncommingBuffer.h
  6. +1
    -1
      code/espurna/libs/pwm.c
  7. +0
    -0
      code/espurna/libs/pwm.h
  8. +1
    -1
      code/espurna/light.ino
  9. +1
    -1
      code/espurna/power.ino
  10. +2
    -2
      code/espurna/settings.ino
  11. +1
    -1
      code/espurna/ws.ino
  12. +4
    -4
      code/platformio.ini

+ 1
- 5
code/espurna/config/general.h View File

@ -514,10 +514,6 @@ PROGMEM const char* const custom_reset_string[] = {
#define LIGHT_SAVE_DELAY 5 // Persist color after 5 seconds to avoid wearing out
#ifndef LIGHT_PWM_FREQUENCY
#define LIGHT_PWM_FREQUENCY 1000 // PWM frequency
#endif
#ifndef LIGHT_MAX_PWM
#if LIGHT_PROVIDER == LIGHT_PROVIDER_MY92XX
@ -525,7 +521,7 @@ PROGMEM const char* const custom_reset_string[] = {
#endif
#if LIGHT_PROVIDER == LIGHT_PROVIDER_DIMMER
#define LIGHT_MAX_PWM 1000
#define LIGHT_MAX_PWM 5000 // 5000 * 200ns => 1 kHz
#endif
#endif // LIGHT_MAX_PWM


+ 2
- 0
code/espurna/config/hardware.h View File

@ -789,6 +789,7 @@
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define DUMMY_RELAY_COUNT 1
#define DEBUG_PORT Serial1
// LEDs
#define LED1_PIN 5
@ -815,6 +816,7 @@
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define DUMMY_RELAY_COUNT 1
#define DEBUG_PORT Serial1
// Light
#define LIGHT_CHANNELS 4


code/espurna/power.h → code/espurna/libs/MedianFilter.h View File


code/espurna/settings.h → code/espurna/libs/StreamInjector.h View File


code/espurna/ws.h → code/espurna/libs/WebSocketIncommingBuffer.h View File


code/espurna/pwm.c → code/espurna/libs/pwm.c View File

@ -25,7 +25,7 @@
#define PWM_MAX_CHANNELS 8
#endif
#define PWM_DEBUG 0
#define PWM_USE_NMI 1
#define PWM_USE_NMI 0
/* no user servicable parts beyond this point */

code/espurna/pwm.h → code/espurna/libs/pwm.h View File


+ 1
- 1
code/espurna/light.ino View File

@ -15,7 +15,7 @@ Copyright (C) 2016-2017 by Xose Pérez <xose dot perez at gmail dot com>
#if LIGHT_PROVIDER == LIGHT_PROVIDER_DIMMER
#define PWM_CHANNEL_NUM_MAX LIGHT_CHANNELS
extern "C" {
#include "pwm.h"
#include "libs/pwm.h"
}
#endif


+ 1
- 1
code/espurna/power.ino View File

@ -12,7 +12,7 @@ Copyright (C) 2016-2017 by Xose Pérez <xose dot perez at gmail dot com>
// MODULE GLOBALS AND CACHE
// -----------------------------------------------------------------------------
#include "power.h"
#include "libs/MedianFilter.h"
#include <Hash.h>
#include <ArduinoJson.h>


+ 2
- 2
code/espurna/settings.ino View File

@ -12,7 +12,7 @@ Copyright (C) 2016-2017 by Xose Pérez <xose dot perez at gmail dot com>
#include <StreamString.h>
#if TELNET_SUPPORT
#include "settings.h"
#include "libs/StreamInjector.h"
#ifdef DEBUG_PORT
StreamInjector _serial = StreamInjector(DEBUG_PORT);
#else
@ -139,7 +139,7 @@ void settingsSetup() {
DEBUG_MSG_P(PSTR("+OK\n"));
});
#endif
Embedis::command( F("INFO"), [](Embedis* e) {
welcome();
DEBUG_MSG_P(PSTR("+OK\n"));


+ 1
- 1
code/espurna/ws.ino View File

@ -13,7 +13,7 @@ Copyright (C) 2016-2017 by Xose Pérez <xose dot perez at gmail dot com>
#include <ArduinoJson.h>
#include <Ticker.h>
#include <vector>
#include "ws.h"
#include "libs/WebSocketIncommingBuffer.h"
AsyncWebSocket _ws("/ws");
Ticker _web_defer;


+ 4
- 4
code/platformio.ini View File

@ -781,7 +781,7 @@ board = esp01_1m
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H801 -DDEBUG_PORT=Serial1
build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H801
monitor_baud = 115200
[env:huacanxing-h801-ota]
@ -791,7 +791,7 @@ board = esp01_1m
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H801 -DDEBUG_PORT=Serial1
build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H801
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
@ -804,7 +804,7 @@ board = esp01_1m
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H802 -DDEBUG_PORT=Serial1
build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H802
monitor_baud = 115200
[env:huacanxing-h802-ota]
@ -814,7 +814,7 @@ board = esp01_1m
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H802 -DDEBUG_PORT=Serial1
build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DHUACANXING_H802
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266


Loading…
Cancel
Save