Skip to content

Commit

Permalink
Merge branch 'warnings' into 'master'
Browse files Browse the repository at this point in the history
Add platformio configuration; fix compilation warnings

See merge request Pwuts/Metertrekker2MQTT!2
  • Loading branch information
Pwuts committed Nov 2, 2019
2 parents 6c02a8c + e74f585 commit ae38431
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SMRtoMQTT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void parseTelegram(char* telegram)
tmpValue = "";
tmpValue.reserve(value.length()/2);

for (int i = 0; i < value.length()/2; i++) {
for (size_t i = 0; i < value.length()/2; i++) {
value.substring(i*2).getBytes(hexbuf, 3);
hexbuf[2] = 0;

Expand Down Expand Up @@ -331,7 +331,7 @@ void parseTelegram(char* telegram)

metricDef* getMetricDef(const char* ident)
{
for (int i = 0; i < sizeof(metricDefs)/sizeof(metricDefs[0]); i++)
for (size_t i = 0; i < sizeof(metricDefs)/sizeof(metricDefs[0]); i++)
{
if (strcmp(ident, metricDefs[i].ident) == 0) {
return &metricDefs[i];
Expand Down
24 changes: 24 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = .

[env:default]
platform = espressif8266
board = d1_mini
framework = arduino
monitor_speed = 115200
upload_speed = 1000000
build_flags = -DMQTT_MAX_PACKET_SIZE=1024
lib_ldf_mode = deep
lib_deps =
PubSubClient

0 comments on commit ae38431

Please sign in to comment.