Browse Source

Merge pull request #361 from DanielR92/dev03

app.cpp make nicer readable and shorten if statements
pull/373/head
Lukas Pusch 2 years ago
committed by GitHub
parent
commit
2af55cb685
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      tools/esp8266/.vscode/settings.json
  2. 616
      tools/esp8266/app.cpp
  3. 24
      tools/esp8266/platformio.ini
  4. 6
      tools/rpi/hoymiles/__main__.py

23
tools/esp8266/.vscode/settings.json

@ -0,0 +1,23 @@
// Place your settings in this file to overwrite default and user settings.
{
// identify that settings is loaded
"workbench.colorCustomizations": {
"editorLineNumber.foreground": "#00ff00"
},
"editor.wordWrap": "off",
"files.eol" : "\n",
"files.trimTrailingWhitespace" : true,
"diffEditor.ignoreTrimWhitespace": true,
"files.autoSave": "afterDelay",
"editor.tabSize": 4,
"editor.insertSpaces": true,
// `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents.
// Set to false to keep the values you've explicitly set, above.
"editor.detectIndentation": false,
// https://clang.llvm.org/docs/ClangFormatStyleOptions.html
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0}",
}

616
tools/esp8266/app.cpp

File diff suppressed because it is too large

24
tools/esp8266/platformio.ini

@ -14,16 +14,16 @@ src_dir = .
[env]
framework = arduino
build_flags =
build_flags =
-include "config.h"
; ;;;;; Possible Debug options ;;;;;;
; https://docs.platformio.org/en/latest/platforms/espressif8266.html#debug-level
;-DDEBUG_ESP_PORT=Serial
;-DDEBUG_ESP_CORE
;-DDEBUG_ESP_WIFI
;-DDEBUG_ESP_HTTP_CLIENT
;-DDEBUG_ESP_HTTP_SERVER
;-DDEBUG_ESP_OOM
;-DDEBUG_ESP_CORE
;-DDEBUG_ESP_WIFI
;-DDEBUG_ESP_HTTP_CLIENT
;-DDEBUG_ESP_HTTP_SERVER
;-DDEBUG_ESP_OOM
monitor_speed = 115200
@ -31,7 +31,7 @@ extra_scripts =
pre:scripts/auto_firmware_version.py
pre:html/convert.py
lib_deps =
lib_deps =
https://github.com/yubox-node-org/ESPAsyncWebServer
nrf24/RF24
paulstoffregen/Time
@ -48,7 +48,7 @@ platform = espressif8266
board = esp12e
board_build.f_cpu = 80000000L
build_flags = -D RELEASE
monitor_filters =
monitor_filters =
;default ; Remove typical terminal control codes from input
time ; Add timestamp with milliseconds for each new line
;log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory
@ -59,7 +59,7 @@ board = esp12e
board_build.f_cpu = 80000000L
build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial
build_type = debug
monitor_filters =
monitor_filters =
;default ; Remove typical terminal control codes from input
time ; Add timestamp with milliseconds for each new line
log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory
@ -69,8 +69,7 @@ platform = espressif32
board = lolin_d32
build_flags = -D RELEASE -std=gnu++14
build_unflags = -std=gnu++11
upload_port = /dev/cu.SLAB_USBtoUART
monitor_filters =
monitor_filters =
;default ; Remove typical terminal control codes from input
time ; Add timestamp with milliseconds for each new line
;log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory
@ -81,8 +80,7 @@ board = lolin_d32
build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial -std=gnu++14
build_unflags = -std=gnu++11
build_type = debug
upload_port = /dev/cu.SLAB_USBtoUART
monitor_filters =
monitor_filters =
;default ; Remove typical terminal control codes from input
time ; Add timestamp with milliseconds for each new line
log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory

6
tools/rpi/hoymiles/__main__.py

@ -322,8 +322,10 @@ if __name__ == '__main__':
print('', end='', flush=True)
if loop_interval > 0 and (time.time() - t_loop_start) < loop_interval:
time.sleep(loop_interval - (time.time() - t_loop_start))
time_to_sleep = loop_interval - (time.time() - t_loop_start)
if loop_interval > 0 and time_to_sleep > 0:
time.sleep(time_to_sleep)
except KeyboardInterrupt:
sys.exit()

Loading…
Cancel
Save