mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 06:32:06 +00:00
misc NRF52 fixes
This commit is contained in:
parent
2061706c11
commit
fe3cbeed3a
10
.vscode/launch.json
vendored
10
.vscode/launch.json
vendored
@ -12,8 +12,9 @@
|
|||||||
"type": "platformio-debug",
|
"type": "platformio-debug",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "PIO Debug",
|
"name": "PIO Debug",
|
||||||
"executable": "/home/kevinh/development/meshtastic/meshtastic-esp32/.pio/build/tbeam/firmware.elf",
|
"executable": "/home/kevinh/development/meshtastic/meshtastic-esp32/.pio/build/bare/firmware.elf",
|
||||||
"toolchainBinDir": "/home/kevinh/.platformio/packages/toolchain-xtensa32/bin",
|
"toolchainBinDir": "/home/kevinh/.platformio/packages/toolchain-gccarmnoneeabi/bin",
|
||||||
|
"svdPath": "/home/kevinh/.platformio/platforms/nordicnrf52/misc/svd/nrf52840.svd",
|
||||||
"preLaunchTask": {
|
"preLaunchTask": {
|
||||||
"type": "PlatformIO",
|
"type": "PlatformIO",
|
||||||
"task": "Pre-Debug"
|
"task": "Pre-Debug"
|
||||||
@ -24,8 +25,9 @@
|
|||||||
"type": "platformio-debug",
|
"type": "platformio-debug",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "PIO Debug (skip Pre-Debug)",
|
"name": "PIO Debug (skip Pre-Debug)",
|
||||||
"executable": "/home/kevinh/development/meshtastic/meshtastic-esp32/.pio/build/tbeam/firmware.elf",
|
"executable": "/home/kevinh/development/meshtastic/meshtastic-esp32/.pio/build/bare/firmware.elf",
|
||||||
"toolchainBinDir": "/home/kevinh/.platformio/packages/toolchain-xtensa32/bin",
|
"toolchainBinDir": "/home/kevinh/.platformio/packages/toolchain-gccarmnoneeabi/bin",
|
||||||
|
"svdPath": "/home/kevinh/.platformio/platforms/nordicnrf52/misc/svd/nrf52840.svd",
|
||||||
"internalConsoleOptions": "openOnSessionStart"
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = tbeam
|
default_envs = bare
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
; common is not currently used
|
; common is not currently used
|
||||||
|
@ -11,6 +11,7 @@ typedef uint8_t PacketId; // A packet sequence number
|
|||||||
|
|
||||||
#define NODENUM_BROADCAST 255
|
#define NODENUM_BROADCAST 255
|
||||||
#define ERRNO_OK 0
|
#define ERRNO_OK 0
|
||||||
|
#define ERRNO_NO_INTERFACES 33
|
||||||
#define ERRNO_UNKNOWN 32 // pick something that doesn't conflict with RH_ROUTER_ERROR_UNABLE_TO_DELIVER
|
#define ERRNO_UNKNOWN 32 // pick something that doesn't conflict with RH_ROUTER_ERROR_UNABLE_TO_DELIVER
|
||||||
|
|
||||||
typedef int ErrorCode;
|
typedef int ErrorCode;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
#include <assert.h>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
template <class T> class Observable;
|
template <class T> class Observable;
|
||||||
@ -14,7 +14,6 @@ template <class T> class Observer
|
|||||||
Observable<T> *observed = NULL;
|
Observable<T> *observed = NULL;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~Observer();
|
virtual ~Observer();
|
||||||
|
|
||||||
void observe(Observable<T> *o);
|
void observe(Observable<T> *o);
|
||||||
|
13
src/bare/main-nrf52.cpp
Normal file
13
src/bare/main-nrf52.cpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
static inline void debugger_break(void)
|
||||||
|
{
|
||||||
|
__asm volatile("bkpt #0x01\n\t"
|
||||||
|
"mov pc, lr\n\t");
|
||||||
|
}
|
||||||
|
|
||||||
|
// handle standard gcc assert failures
|
||||||
|
void __attribute__((noreturn)) __assert_func(const char *file, int line, const char *func, const char *failedexpr)
|
||||||
|
{
|
||||||
|
debugger_break();
|
||||||
|
}
|
@ -114,6 +114,11 @@ bool RH_RF95::init()
|
|||||||
return enableInterrupt();
|
return enableInterrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If on a platform without level trigger definitions, just use RISING and suck it up.
|
||||||
|
#ifndef ONHIGH
|
||||||
|
#define ONHIGH RISING
|
||||||
|
#endif
|
||||||
|
|
||||||
bool RH_RF95::enableInterrupt()
|
bool RH_RF95::enableInterrupt()
|
||||||
{
|
{
|
||||||
// Determine the interrupt number that corresponds to the interruptPin
|
// Determine the interrupt number that corresponds to the interruptPin
|
||||||
|
@ -39,6 +39,16 @@ class RadioInterface
|
|||||||
|
|
||||||
virtual void loop() {} // Idle processing
|
virtual void loop() {} // Idle processing
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if we think the board can go to sleep (i.e. our tx queue is empty, we are not sending or receiving)
|
||||||
|
*
|
||||||
|
* This method must be used before putting the CPU into deep or light sleep.
|
||||||
|
*/
|
||||||
|
bool canSleep() { return true; }
|
||||||
|
|
||||||
|
/// Prepare hardware for sleep. Call this _only_ for deep sleep, not needed for light sleep.
|
||||||
|
virtual bool sleep() { return true; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a packet (possibly by enquing in a private fifo). This routine will
|
* Send a packet (possibly by enquing in a private fifo). This routine will
|
||||||
* later free() the packet to pool. This routine is not allowed to stall.
|
* later free() the packet to pool. This routine is not allowed to stall.
|
||||||
|
Loading…
Reference in New Issue
Block a user