I’ve not had much luck with my post in the mysensors forum, so I thought I’d try here as well before I start creating GH issues.
Basically, I used platformio (cli) with an Arduino Nano to build this sketch using these instructions with minimal issues – one private function I had to move around (known issue) but other than that it worked like a charm.
Now I want to make a version of the same sketch using an atmega328p on a breadboard. I’m hoping it should work as it’s the same MCU.
However, I’m running into a slew of errors, mostly “not declared in this scope.” My INO file is unchanged.
In file included from .piolibdeps/MySensors_ID548/MySensors.h:257:0,
.piolibdeps/MySensors_ID548/core/MyTransport.cpp: In function 'void stInitTransition()':
.piolibdeps/MySensors_ID548/core/MyTransport.cpp:80:45: error: 'hwReadConfigBlock' was not declared in this scope
.piolibdeps/MySensors_ID548/core/MyTransport.cpp: In function 'void stInitUpdate()':
.piolibdeps/MySensors_ID548/core/MyTransport.cpp:108:61: error: 'hwWriteConfig' was not declared in this scope
.piolibdeps/MySensors_ID548/core/MyTransport.cpp: In function 'void stUplinkUpdate()':
.piolibdeps/MySensors_ID548/core/MyTransport.cpp:232:43: error: 'hwMillis' was not declared in this scope
_transportSM.lastUplinkCheck = hwMillis();
.piolibdeps/MySensors_ID548/core/MyTransport.cpp: In function 'void transportSwitchSM(transportState_t&)':
.piolibdeps/MySensors_ID548/core/MyTransport.cpp:342:37: error: 'hwMillis' was not declared in this scope
_transportSM.stateEnter = hwMillis(); // save time
.piolibdeps/MySensors_ID548/core/MyTransport.cpp: In function 'uint32_t transportTimeInState()':
.piolibdeps/MySensors_ID548/core/MyTransport.cpp:347:18: error: 'hwMillis' was not declared in this scope
return hwMillis() - _transportSM.stateEnter;
So far I’ve found a few useful links:
What I’ve tried (with a
pio run target=clean before each attempted build):
#include <Arduino.h> or
#include "Arduino.h" to the top of my sketch
build_flags = -I/path/to/MySensors
lib_ignore = MySensors
platform = atmelavr
board = 328p8m
framework = arduino
upload_protocol = usbasp
Any ideas? Again, this builds fine with the same code but using a nano as the target platform, just won’t build for the atmega328p for some reason. Thanks for any help you can provide!
- platformio (cli) 3.4.1
- mysensors (lib #548) 2.1.1
- MacOS 10.13.1