mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-27 10:21:40 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
11444621ae
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
export VERSION=0.7.9
|
export VERSION=0.7.10
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
You probably don't care about this section - skip to the next one.
|
You probably don't care about this section - skip to the next one.
|
||||||
|
|
||||||
- implement first cut of router mode: preferentially handle flooding, and change sleep and GPS behaviors
|
- implement first cut of router mode: preferentially handle flooding, and change sleep and GPS behaviors (plan for geofence mode and battery save mode)
|
||||||
- NRF52 BLE support
|
- NRF52 BLE support
|
||||||
|
|
||||||
# Medium priority
|
# Medium priority
|
||||||
|
@ -32,8 +32,8 @@ optimizations / low priority:
|
|||||||
|
|
||||||
- read this [this](http://pages.cs.wisc.edu/~suman/pubs/nadv-mobihoc05.pdf) paper and others and make our naive flood routing less naive
|
- read this [this](http://pages.cs.wisc.edu/~suman/pubs/nadv-mobihoc05.pdf) paper and others and make our naive flood routing less naive
|
||||||
- read @cyclomies long email with good ideas on optimizations and reply
|
- read @cyclomies long email with good ideas on optimizations and reply
|
||||||
- Remove NodeNum assignment algorithm (now that we use 4 byte node nums)
|
- DONE Remove NodeNum assignment algorithm (now that we use 4 byte node nums)
|
||||||
- make android app warn if firmware is too old or too new to talk to
|
- DONE make android app warn if firmware is too old or too new to talk to
|
||||||
- change nodenums and packetids in protobuf to be fixed32
|
- change nodenums and packetids in protobuf to be fixed32
|
||||||
- low priority: think more careful about reliable retransmit intervals
|
- low priority: think more careful about reliable retransmit intervals
|
||||||
- make ReliableRouter.pending threadsafe
|
- make ReliableRouter.pending threadsafe
|
||||||
|
@ -23,6 +23,8 @@ default_envs = tbeam ; Note: the github actions CI test build can't yet build NR
|
|||||||
|
|
||||||
[env]
|
[env]
|
||||||
|
|
||||||
|
framework = arduino
|
||||||
|
|
||||||
; customize the partition table
|
; customize the partition table
|
||||||
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
||||||
board_build.partitions = partition-table.csv
|
board_build.partitions = partition-table.csv
|
||||||
@ -78,7 +80,6 @@ lib_deps =
|
|||||||
; Common settings for ESP targes, mixin with extends = esp32_base
|
; Common settings for ESP targes, mixin with extends = esp32_base
|
||||||
[esp32_base]
|
[esp32_base]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
framework = arduino
|
|
||||||
src_filter =
|
src_filter =
|
||||||
${env.src_filter} -<nrf52/>
|
${env.src_filter} -<nrf52/>
|
||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
@ -133,7 +134,6 @@ build_flags =
|
|||||||
; For more details see my post in the forum.
|
; For more details see my post in the forum.
|
||||||
[env:cubecellplus]
|
[env:cubecellplus]
|
||||||
platform = https://github.com/HelTecAutomation/platform-asrmicro650x.git ; we use top-of-tree because stable version has too many bugs - asrmicro650x
|
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
|
board = cubecell_board_plus
|
||||||
; FIXME, bug in cubecell arduino - they are supposed to set ARDUINO
|
; FIXME, bug in cubecell arduino - they are supposed to set ARDUINO
|
||||||
build_flags = ${env.build_flags} -DARDUINO=100 -Isrc/cubecell
|
build_flags = ${env.build_flags} -DARDUINO=100 -Isrc/cubecell
|
||||||
@ -143,7 +143,6 @@ src_filter =
|
|||||||
; Common settings for NRF52 based targets
|
; Common settings for NRF52 based targets
|
||||||
[nrf52_base]
|
[nrf52_base]
|
||||||
platform = nordicnrf52
|
platform = nordicnrf52
|
||||||
framework = arduino
|
|
||||||
debug_tool = jlink
|
debug_tool = jlink
|
||||||
build_type = debug ; I'm debugging with ICE a lot now
|
build_type = debug ; I'm debugging with ICE a lot now
|
||||||
; note: liboberon provides the AES256 implementation for NRF52 (though not using the hardware acceleration of the NRF52840 - FIXME)
|
; note: liboberon provides the AES256 implementation for NRF52 (though not using the hardware acceleration of the NRF52840 - FIXME)
|
||||||
|
21
src/main.cpp
21
src/main.cpp
@ -37,8 +37,8 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include <Wire.h>
|
|
||||||
#include <OneButton.h>
|
#include <OneButton.h>
|
||||||
|
#include <Wire.h>
|
||||||
// #include <driver/rtc_io.h>
|
// #include <driver/rtc_io.h>
|
||||||
|
|
||||||
#ifndef NO_ESP32
|
#ifndef NO_ESP32
|
||||||
@ -134,15 +134,17 @@ Periodic ledPeriodic(ledBlinker);
|
|||||||
|
|
||||||
// Prepare for button presses
|
// Prepare for button presses
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
OneButton userButton;
|
OneButton userButton;
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUTTON_PIN_ALT
|
#ifdef BUTTON_PIN_ALT
|
||||||
OneButton userButtonAlt;
|
OneButton userButtonAlt;
|
||||||
#endif
|
#endif
|
||||||
void userButtonPressed() {
|
void userButtonPressed()
|
||||||
|
{
|
||||||
powerFSM.trigger(EVENT_PRESS);
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
}
|
}
|
||||||
void userButtonPressedLong(){
|
void userButtonPressedLong()
|
||||||
|
{
|
||||||
screen.adjustBrightness();
|
screen.adjustBrightness();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,6 +231,10 @@ void setup()
|
|||||||
ssd1306_found = false; // forget we even have the hardware
|
ssd1306_found = false; // forget we even have the hardware
|
||||||
|
|
||||||
esp32Setup();
|
esp32Setup();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef TBEAM_V10
|
||||||
|
// Currently only the tbeam has a PMU
|
||||||
power = new Power();
|
power = new Power();
|
||||||
power->setup();
|
power->setup();
|
||||||
power->setStatusHandler(powerStatus);
|
power->setStatusHandler(powerStatus);
|
||||||
@ -306,7 +312,6 @@ void setup()
|
|||||||
// This must be _after_ service.init because we need our preferences loaded from flash to have proper timeout values
|
// This must be _after_ service.init because we need our preferences loaded from flash to have proper timeout values
|
||||||
PowerFSM_setup(); // we will transition to ON in a couple of seconds, FIXME, only do this for cold boots, not waking from SDS
|
PowerFSM_setup(); // we will transition to ON in a couple of seconds, FIXME, only do this for cold boots, not waking from SDS
|
||||||
|
|
||||||
|
|
||||||
// setBluetoothEnable(false); we now don't start bluetooth until we enter the proper state
|
// setBluetoothEnable(false); we now don't start bluetooth until we enter the proper state
|
||||||
setCPUFast(false); // 80MHz is fine for our slow peripherals
|
setCPUFast(false); // 80MHz is fine for our slow peripherals
|
||||||
}
|
}
|
||||||
@ -352,6 +357,8 @@ void loop()
|
|||||||
|
|
||||||
#ifndef NO_ESP32
|
#ifndef NO_ESP32
|
||||||
esp32Loop();
|
esp32Loop();
|
||||||
|
#endif
|
||||||
|
#ifdef TBEAM_V10
|
||||||
power->loop();
|
power->loop();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -379,7 +386,7 @@ void loop()
|
|||||||
|
|
||||||
// Update the screen last, after we've figured out what to show.
|
// Update the screen last, after we've figured out what to show.
|
||||||
screen.debug()->setChannelNameStatus(channelSettings.name);
|
screen.debug()->setChannelNameStatus(channelSettings.name);
|
||||||
//screen.debug()->setPowerStatus(powerStatus);
|
// screen.debug()->setPowerStatus(powerStatus);
|
||||||
|
|
||||||
// No GPS lock yet, let the OS put the main CPU in low power mode for 100ms (or until another interrupt comes in)
|
// No GPS lock yet, let the OS put the main CPU in low power mode for 100ms (or until another interrupt comes in)
|
||||||
// i.e. don't just keep spinning in loop as fast as we can.
|
// i.e. don't just keep spinning in loop as fast as we can.
|
||||||
|
@ -55,8 +55,13 @@ static FrameCallback normalFrames[MAX_NUM_NODES + NUM_EXTRA_FRAMES];
|
|||||||
static uint32_t targetFramerate = IDLE_FRAMERATE;
|
static uint32_t targetFramerate = IDLE_FRAMERATE;
|
||||||
static char btPIN[16] = "888888";
|
static char btPIN[16] = "888888";
|
||||||
|
|
||||||
uint8_t imgBattery[16] = { 0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xE7, 0x3C };
|
uint8_t imgBattery[16] = {0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xE7, 0x3C};
|
||||||
|
|
||||||
|
// if defined a pixel will blink to show redraws
|
||||||
|
// #define SHOW_REDRAWS
|
||||||
|
#ifdef SHOW_REDRAWS
|
||||||
static bool heartbeat = false;
|
static bool heartbeat = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
static void drawBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
static void drawBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
@ -179,8 +184,8 @@ static void drawColumns(OLEDDisplay *display, int16_t x, int16_t y, const char *
|
|||||||
// Draw power bars or a charging indicator on an image of a battery, determined by battery charge voltage or percentage.
|
// Draw power bars or a charging indicator on an image of a battery, determined by battery charge voltage or percentage.
|
||||||
static void drawBattery(OLEDDisplay *display, int16_t x, int16_t y, uint8_t *imgBuffer, const PowerStatus *powerStatus)
|
static void drawBattery(OLEDDisplay *display, int16_t x, int16_t y, uint8_t *imgBuffer, const PowerStatus *powerStatus)
|
||||||
{
|
{
|
||||||
static const uint8_t powerBar[3] = { 0x81, 0xBD, 0xBD };
|
static const uint8_t powerBar[3] = {0x81, 0xBD, 0xBD};
|
||||||
static const uint8_t lightning[8] = { 0xA1, 0xA1, 0xA5, 0xAD, 0xB5, 0xA5, 0x85, 0x85 };
|
static const uint8_t lightning[8] = {0xA1, 0xA1, 0xA5, 0xAD, 0xB5, 0xA5, 0x85, 0x85};
|
||||||
// Clear the bar area on the battery image
|
// Clear the bar area on the battery image
|
||||||
for (int i = 1; i < 14; i++) {
|
for (int i = 1; i < 14; i++) {
|
||||||
imgBuffer[i] = 0x81;
|
imgBuffer[i] = 0x81;
|
||||||
@ -191,7 +196,7 @@ static void drawBattery(OLEDDisplay *display, int16_t x, int16_t y, uint8_t *img
|
|||||||
// If not charging, Draw power bars
|
// If not charging, Draw power bars
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
if(powerStatus->getBatteryChargePercent() >= 25 * i)
|
if (powerStatus->getBatteryChargePercent() >= 25 * i)
|
||||||
memcpy(imgBuffer + 1 + (i * 3), powerBar, 3);
|
memcpy(imgBuffer + 1 + (i * 3), powerBar, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -765,10 +770,12 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
|||||||
|
|
||||||
display->drawLogBuffer(x, y + (FONT_HEIGHT * 2));
|
display->drawLogBuffer(x, y + (FONT_HEIGHT * 2));
|
||||||
|
|
||||||
/* Display a heartbeat pixel that blinks every time the frame is redrawn
|
/* Display a heartbeat pixel that blinks every time the frame is redrawn */
|
||||||
if(heartbeat) display->setPixel(0, 0);
|
#ifdef SHOW_REDRAWS
|
||||||
|
if (heartbeat)
|
||||||
|
display->setPixel(0, 0);
|
||||||
heartbeat = !heartbeat;
|
heartbeat = !heartbeat;
|
||||||
*/
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// adjust Brightness cycle trough 1 to 254 as long as attachDuringLongPress is true
|
// adjust Brightness cycle trough 1 to 254 as long as attachDuringLongPress is true
|
||||||
@ -786,13 +793,13 @@ void Screen::adjustBrightness()
|
|||||||
dispdev.setBrightness(brightness);
|
dispdev.setBrightness(brightness);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Screen::handleStatusUpdate(const Status *arg) {
|
int Screen::handleStatusUpdate(const Status *arg)
|
||||||
|
{
|
||||||
DEBUG_MSG("Screen got status update %d\n", arg->getStatusType());
|
DEBUG_MSG("Screen got status update %d\n", arg->getStatusType());
|
||||||
switch(arg->getStatusType())
|
switch (arg->getStatusType()) {
|
||||||
{
|
case STATUS_TYPE_NODE:
|
||||||
case STATUS_TYPE_NODE:
|
setFrames();
|
||||||
setFrames();
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
setPeriod(1); // Update the screen right away
|
setPeriod(1); // Update the screen right away
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user