1.2-legacy
geeksville 2020-06-05 17:30:09 -07:00
rodzic 5915669f6f
commit 1c63a70673
8 zmienionych plików z 66 dodań i 3 usunięć

Wyświetl plik

@ -0,0 +1,6 @@
https://heltec-automation-docs.readthedocs.io/en/latest/cubecell/index.html
https://github.com/HelTecAutomation/ASR650x-Arduino?utm_source=platformio.org&utm_medium=docs
* Either portfreertos or make not theaded versions of Lock, WorkerThread, Queue (probably the latter).

Wyświetl plik

@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html ; https://docs.platformio.org/page/projectconf.html
[platformio] [platformio]
default_envs = tbeam ; Note: the github actions CI test build can't yet build NRF52 targets default_envs = cubecellplus ; Note: the github actions CI test build can't yet build NRF52 targets
[common] [common]
; common is not currently used ; common is not currently used
@ -123,6 +123,16 @@ board = ttgo-lora32-v1
build_flags = build_flags =
${esp32_base.build_flags} -D TTGO_LORA_V2 ${esp32_base.build_flags} -D TTGO_LORA_V2
; The Heltec Cubecell plus
[env:cubecellplus]
platform = https://github.com/HelTecAutomation/platform-asrmicro650x.git ; we use top-of-tree because stable version has too many bugs - asrmicro650x
framework = arduino
board = cubecell_board_plus
; FIXME, bug in cubecell arduino - they are supposed to set ARDUINO
build_flags = ${env.build_flags} -DARDUINO=100
src_filter =
${env.src_filter} -<esp32/>
; Common settings for NRF52 based targets ; Common settings for NRF52 based targets
[nrf52_base] [nrf52_base]
platform = nordicnrf52 platform = nordicnrf52

Wyświetl plik

@ -1,6 +1,8 @@
#include "WorkerThread.h" #include "WorkerThread.h"
#include <assert.h> #include <assert.h>
#ifdef configUSE_PREEMPTION
void Thread::start(const char *name, size_t stackSize, uint32_t priority) void Thread::start(const char *name, size_t stackSize, uint32_t priority)
{ {
auto r = xTaskCreate(callRun, name, stackSize, this, priority, &taskHandle); auto r = xTaskCreate(callRun, name, stackSize, this, priority, &taskHandle);
@ -35,3 +37,5 @@ void NotifiedWorkerThread::block()
xTaskNotifyWait(0, // don't clear notification on entry xTaskNotifyWait(0, // don't clear notification on entry
clearOnRead, &notification, portMAX_DELAY); // Wait forever clearOnRead, &notification, portMAX_DELAY); // Wait forever
} }
#endif

Wyświetl plik

@ -1,5 +1,8 @@
#include <Arduino.h> #include <Arduino.h>
// FIXME - ugly check to see if we have freertos
#ifdef configUSE_PREEMPTION
class Thread class Thread
{ {
protected: protected:
@ -87,3 +90,5 @@ class NotifiedWorkerThread : public WorkerThread
*/ */
virtual void block(); virtual void block();
}; };
#endif

Wyświetl plik

@ -73,6 +73,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BUTTON_PIN PIN_BUTTON1 #define BUTTON_PIN PIN_BUTTON1
// FIXME, use variant.h defs for all of this!!! (even on the ESP32 targets) // FIXME, use variant.h defs for all of this!!! (even on the ESP32 targets)
#elif defined(CubeCell_BoardPlus)
//
// Standard definitions for CubeCell targets
//
#define NO_ESP32 // Don't use ESP32 libs (mainly bluetooth)
// We bind to the GPS using variant.h instead for this platform (Serial1)
// FIXME, not yet ready for NRF52
#define RTC_DATA_ATTR
#define LED_PIN PIN_LED1 // LED1 on nrf52840-DK
#define BUTTON_PIN PIN_BUTTON1
#else #else
// //
@ -256,9 +272,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEBUG_PORT console // Serial debug port #define DEBUG_PORT console // Serial debug port
#ifdef NO_ESP32 // What platforms should use SEGGER?
#ifdef NRF52_SERIES
#define USE_SEGGER #define USE_SEGGER
#endif #endif
#ifdef USE_SEGGER #ifdef USE_SEGGER
#include "SEGGER_RTT.h" #include "SEGGER_RTT.h"
#define DEBUG_MSG(...) SEGGER_RTT_printf(0, __VA_ARGS__) #define DEBUG_MSG(...) SEGGER_RTT_printf(0, __VA_ARGS__)

Wyświetl plik

@ -9,8 +9,11 @@
#include <freertos/semphr.h> #include <freertos/semphr.h>
#include <freertos/queue.h> #include <freertos/queue.h>
#else #else
// not yet supported on cubecell
#ifndef CubeCell_BoardPlus
#include <FreeRTOS.h> #include <FreeRTOS.h>
#include <task.h> #include <task.h>
#include <semphr.h> #include <semphr.h>
#include <queue.h> #include <queue.h>
#endif #endif
#endif

Wyświetl plik

@ -5,6 +5,7 @@
namespace meshtastic namespace meshtastic
{ {
#ifdef configUSE_PREEMPTION
Lock::Lock() Lock::Lock()
{ {
handle = xSemaphoreCreateBinary(); handle = xSemaphoreCreateBinary();
@ -21,6 +22,20 @@ void Lock::unlock()
{ {
assert(xSemaphoreGive(handle)); assert(xSemaphoreGive(handle));
} }
#else
Lock::Lock()
{
}
void Lock::lock()
{
}
void Lock::unlock()
{
}
#endif
LockGuard::LockGuard(Lock *lock) : lock(lock) LockGuard::LockGuard(Lock *lock) : lock(lock)
{ {

Wyświetl plik

@ -25,7 +25,9 @@ class Lock
void unlock(); void unlock();
private: private:
#ifdef configUSE_PREEMPTION
SemaphoreHandle_t handle; SemaphoreHandle_t handle;
#endif
}; };
// RAII lock guard. // RAII lock guard.