Skip to content

Commit

Permalink
pio: inlined config var
Browse files Browse the repository at this point in the history
  • Loading branch information
MacDada committed Apr 30, 2023
1 parent 81b11bb commit 10dc1b0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 deletions.
30 changes: 0 additions & 30 deletions config/common.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,6 @@
lib_deps =
bblanchon/ArduinoJson@^6.21.0

; https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html
project_global_defines_build_flags =
'-D APP_NAME="Furnace"'

'-D SERIAL_BITS_PER_SECOND=115200'

; brown GND
; red 3v3
; orange D2 [pin4 at NodeMcu]
'-D SERVO_PIN=4'

'-D WIFI_SSID="${secret.wifi_ssid}"'
'-D WIFI_PASSWORD="${secret.wifi_password}"'

'-D WEB_SERVER_PORT=${secret.web_server_port}'
'-D WEB_SERVER_HOSTNAME="${secret.web_server_hostname}"'

'-D OTA_UPLOAD_PORT=${secret.ota_upload_port}'
'-D OTA_UPLOAD_HOSTNAME="${secret.ota_upload_hostname}"'
!echo '-D OTA_UPLOAD_PASSWORD_MD5=\\"'$(md5 -q -s ${secret.ota_upload_password})'\\"'

'-D FURNACE_HEATER_BUTTON_PRESSING_ANGLE=0'
'-D FURNACE_HEATER_BUTTON_NOT_PRESSING_ANGLE=90'
'-D FURNACE_HEATER_BUTTON_PRESSING_MILLISECONDS=2000'

; Latest commit hash; `%h` formats it to the short commit hash version:
; https://stackoverflow.com/a/5694454/666907
; https://git-scm.com/docs/pretty-formats/2.39.0
!echo '-D BUILD_GIT_COMMIT_HASH=\\"'$(git log -1 --format=%%h)'\\"'

; https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html
code_quality_build_flags =
; The default for Apple Clang is… `c++98` o.O
Expand Down
30 changes: 29 additions & 1 deletion config/nodemcu.ini
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,35 @@ build_unflags =
; https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html
build_flags =
${common.code_quality_build_flags}
${common.project_global_defines_build_flags}

# `-D`: global macro definitions
'-D APP_NAME="Furnace"'

'-D SERIAL_BITS_PER_SECOND=115200'

; brown GND
; red 3v3
; orange D2 [pin4 at NodeMcu]
'-D SERVO_PIN=4'

'-D WIFI_SSID="${secret.wifi_ssid}"'
'-D WIFI_PASSWORD="${secret.wifi_password}"'

'-D WEB_SERVER_PORT=${secret.web_server_port}'
'-D WEB_SERVER_HOSTNAME="${secret.web_server_hostname}"'

'-D OTA_UPLOAD_PORT=${secret.ota_upload_port}'
'-D OTA_UPLOAD_HOSTNAME="${secret.ota_upload_hostname}"'
!echo '-D OTA_UPLOAD_PASSWORD_MD5=\\"'$(md5 -q -s ${secret.ota_upload_password})'\\"'

'-D FURNACE_HEATER_BUTTON_PRESSING_ANGLE=0'
'-D FURNACE_HEATER_BUTTON_NOT_PRESSING_ANGLE=90'
'-D FURNACE_HEATER_BUTTON_PRESSING_MILLISECONDS=2000'

; Latest commit hash; `%h` formats it to the short commit hash version:
; https://stackoverflow.com/a/5694454/666907
; https://git-scm.com/docs/pretty-formats/2.39.0
!echo '-D BUILD_GIT_COMMIT_HASH=\\"'$(git log -1 --format=%%h)'\\"'

; https://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-deps
lib_deps =
Expand Down

0 comments on commit 10dc1b0

Please sign in to comment.