sforkowany z mirror/meshtastic-firmware
make gps optional. Portduino almost works in sim!
rodzic
97ab07e05c
commit
2a067e7f6b
|
@ -251,6 +251,6 @@ lib_deps =
|
||||||
[env:linux]
|
[env:linux]
|
||||||
platform = https://github.com/geeksville/platform-portduino.git
|
platform = https://github.com/geeksville/platform-portduino.git
|
||||||
src_filter = ${env.src_filter} -<esp32/> -<nimble/> -<nrf52/>
|
src_filter = ${env.src_filter} -<esp32/> -<nimble/> -<nrf52/>
|
||||||
build_flags = ${arduino_base.build_flags}
|
build_flags = ${arduino_base.build_flags} -O0
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board = linux_x86_64
|
board = linux_x86_64
|
||||||
|
|
|
@ -268,7 +268,10 @@ void setup()
|
||||||
gps = new NEMAGPS();
|
gps = new NEMAGPS();
|
||||||
gps->setup();
|
gps->setup();
|
||||||
#endif
|
#endif
|
||||||
gpsStatus->observe(&gps->newStatus);
|
if (gps)
|
||||||
|
gpsStatus->observe(&gps->newStatus);
|
||||||
|
else
|
||||||
|
DEBUG_MSG("Warning: No GPS found - running without GPS\n");
|
||||||
nodeStatus->observe(&nodeDB.newStatus);
|
nodeStatus->observe(&nodeDB.newStatus);
|
||||||
|
|
||||||
service.init();
|
service.init();
|
||||||
|
@ -362,7 +365,8 @@ void loop()
|
||||||
{
|
{
|
||||||
uint32_t msecstosleep = 1000 * 30; // How long can we sleep before we again need to service the main loop?
|
uint32_t msecstosleep = 1000 * 30; // How long can we sleep before we again need to service the main loop?
|
||||||
|
|
||||||
gps->loop(); // FIXME, remove from main, instead block on read
|
if (gps)
|
||||||
|
gps->loop(); // FIXME, remove from main, instead block on read
|
||||||
router.loop();
|
router.loop();
|
||||||
powerFSM.run_machine();
|
powerFSM.run_machine();
|
||||||
service.loop();
|
service.loop();
|
||||||
|
|
|
@ -67,8 +67,8 @@ void MeshService::init()
|
||||||
sendOwnerPeriod.setup();
|
sendOwnerPeriod.setup();
|
||||||
nodeDB.init();
|
nodeDB.init();
|
||||||
|
|
||||||
assert(gps);
|
if (gps)
|
||||||
gpsObserver.observe(&gps->newStatus);
|
gpsObserver.observe(&gps->newStatus);
|
||||||
packetReceivedObserver.observe(&router.notifyPacketReceived);
|
packetReceivedObserver.observe(&router.notifyPacketReceived);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue