Skip to content

Commit

Permalink
fixes for Always On Display and SPI flash ID
Browse files Browse the repository at this point in the history
  • Loading branch information
ljahn authored and NeroBurner committed Sep 16, 2024
1 parent 1c35771 commit 06c4d1f
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion InfiniTime
Submodule InfiniTime updated 63 files
+5 −0 .github/workflows/main.yml
+3 −1 README.md
+99 −0 doc/gettingStarted/Applications.md
+ doc/gettingStarted/AppsScreenshots/2048.png
+ doc/gettingStarted/AppsScreenshots/Dice.png
+ doc/gettingStarted/AppsScreenshots/Heartrate.png
+ doc/gettingStarted/AppsScreenshots/Maps.png
+ doc/gettingStarted/AppsScreenshots/Metronome.png
+ doc/gettingStarted/AppsScreenshots/Music.png
+ doc/gettingStarted/AppsScreenshots/Paint.png
+ doc/gettingStarted/AppsScreenshots/Pong.png
+ doc/gettingStarted/AppsScreenshots/Weather.png
+ doc/gettingStarted/AppsScreenshots/alarm.png
+ doc/gettingStarted/AppsScreenshots/steps.png
+ doc/gettingStarted/AppsScreenshots/stopwatch.png
+ doc/gettingStarted/AppsScreenshots/timer.png
+31 −0 doc/gettingStarted/Watchfaces.md
+ doc/gettingStarted/Watchfaces/Analog.png
+ doc/gettingStarted/Watchfaces/CasioG7710.png
+ doc/gettingStarted/Watchfaces/Digital.png
+ doc/gettingStarted/Watchfaces/Infinineat.png
+ doc/gettingStarted/Watchfaces/PineTimeStyle.png
+ doc/gettingStarted/Watchfaces/Terminal.png
+ doc/gettingStarted/gadgetbridge0.jpg
+ doc/gettingStarted/gadgetbridge1.jpg
+ doc/gettingStarted/gadgetbridge2.jpg
+ doc/gettingStarted/gadgetbridge3.jpg
+ doc/gettingStarted/gadgetbridge4.jpg
+ doc/gettingStarted/gadgetbridge5.jpg
+2 −2 doc/gettingStarted/gettingStarted-1.0.md
+13 −7 doc/gettingStarted/ota-gadgetbridge.md
+2 −2 doc/gettingStarted/updating-software.md
+ doc/gettingStarted/validate.png
+ doc/gettingStarted/version.png
+0 −1 src/CMakeLists.txt
+4 −4 src/components/ble/DfuService.h
+3 −3 src/components/ble/HeartRateService.h
+4 −1 src/components/ble/NimbleController.cpp
+0 −4 src/components/ble/NimbleController.h
+112 −12 src/components/brightness/BrightnessController.cpp
+23 −1 src/components/brightness/BrightnessController.h
+18 −1 src/components/settings/Settings.h
+95 −36 src/displayapp/DisplayApp.cpp
+10 −1 src/displayapp/DisplayApp.h
+2 −1 src/displayapp/DisplayAppRecovery.cpp
+3 −1 src/displayapp/DisplayAppRecovery.h
+3 −3 src/displayapp/Messages.h
+2 −2 src/displayapp/screens/FirmwareValidation.cpp
+2 −0 src/displayapp/screens/FlashLight.cpp
+1 −0 src/displayapp/screens/FlashLight.h
+9 −2 src/displayapp/screens/SystemInfo.cpp
+3 −1 src/displayapp/screens/SystemInfo.h
+11 −8 src/displayapp/screens/Timer.cpp
+3 −0 src/displayapp/screens/Timer.h
+21 −2 src/displayapp/screens/settings/SettingDisplay.cpp
+2 −0 src/displayapp/screens/settings/SettingDisplay.h
+7 −3 src/drivers/SpiNorFlash.cpp
+4 −1 src/drivers/SpiNorFlash.h
+98 −0 src/drivers/St7789.cpp
+20 −0 src/drivers/St7789.h
+2 −1 src/main.cpp
+1 −1 src/systemtask/SystemMonitor.cpp
+14 −10 src/systemtask/SystemTask.cpp
3 changes: 2 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ Pinetime::Applications::DisplayApp displayApp(lcd,
alarmController,
brightnessController,
touchHandler,
fs);
fs,
spiNorFlash);

Pinetime::System::SystemTask systemTask(spi,
spiNorFlash,
Expand Down
2 changes: 1 addition & 1 deletion sim/components/brightness/BrightnessController.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Pinetime {
namespace Controllers {
class BrightnessController {
public:
enum class Levels { Off, Low, Medium, High };
enum class Levels { Off, AlwaysOn, Low, Medium, High };
void Init();

void Set(Levels level);
Expand Down
8 changes: 6 additions & 2 deletions sim/drivers/SpiNorFlash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SpiNorFlash::~SpiNorFlash() {
}

void SpiNorFlash::Init() {
device_id = ReadIdentificaion();
device_id = ReadIdentification();
NRF_LOG_INFO(
"[SpiNorFlash] Manufacturer : %d, Memory type : %d, memory density : %d", device_id.manufacturer, device_id.type, device_id.density);
}
Expand All @@ -42,7 +42,7 @@ void SpiNorFlash::Wakeup() {
NRF_LOG_INFO("[SpiNorFlash] Wakeup")
}

SpiNorFlash::Identification SpiNorFlash::ReadIdentificaion() {
SpiNorFlash::Identification SpiNorFlash::ReadIdentification() {
return {};
}

Expand Down Expand Up @@ -91,6 +91,10 @@ bool SpiNorFlash::EraseFailed() {
return false;
}

SpiNorFlash::Identification SpiNorFlash::GetIdentification() const {
return device_id;
}

void SpiNorFlash::Write(uint32_t address, const uint8_t* buffer, size_t size) {
if (address + size * sizeof(uint8_t) > memorySize) {
throw std::runtime_error("SpiNorFlash::Write out of bounds");
Expand Down
5 changes: 4 additions & 1 deletion sim/drivers/SpiNorFlash.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ namespace Pinetime {
uint8_t density = 0;
};

Identification ReadIdentificaion();
uint8_t ReadStatusRegister();
bool WriteInProgress();
bool WriteEnabled();
Expand All @@ -34,13 +33,17 @@ namespace Pinetime {
bool ProgramFailed();
bool EraseFailed();

Identification GetIdentification() const;

void Init();
void Uninit();

void Sleep();
void Wakeup();

private:
Identification ReadIdentification();

enum class Commands : uint8_t {
PageProgram = 0x02,
Read = 0x03,
Expand Down
3 changes: 3 additions & 0 deletions sim/nrfx/hal/nrf_gpio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ void nrfx_gpiote_in_init(uint32_t pin_number, nrfx_gpiote_in_config_t *config, n
void nrfx_gpiote_in_event_enable(uint32_t pin_number, bool enable) {}
void nrf_gpio_cfg_sense_input(uint32_t pin_number, nrf_gpio_pin_pull_t pin_pull, nrf_gpio_pin_sense_t sense) {}

bool nrfx_gpiote_is_init() { return true; }
void nrfx_gpiote_init() {}

void APP_GPIOTE_INIT(uint32_t max_users) {}
3 changes: 3 additions & 0 deletions sim/nrfx/hal/nrf_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ void nrfx_gpiote_in_init(uint32_t pin_number, nrfx_gpiote_in_config_t *config, n
void nrfx_gpiote_in_event_enable(uint32_t pin_number, bool enable);
void nrf_gpio_cfg_sense_input(uint32_t pin_number, nrf_gpio_pin_pull_t pin_pull, nrf_gpio_pin_sense_t sense);

bool nrfx_gpiote_is_init();
void nrfx_gpiote_init();

void APP_GPIOTE_INIT(uint32_t max_users);

#endif // NRF_GPIO_H__
10 changes: 10 additions & 0 deletions sim/portmacro_cmsis.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
#ifndef PORTMACRO_CMSIS_H
#define PORTMACRO_CMSIS_H

// ########## macro taken from app_util.h
/**@brief Macro for performing rounded integer division (as opposed to truncating the result).
*
* @param[in] A Numerator.
* @param[in] B Denominator.
*
* @return Rounded (integer) result of dividing A by B.
*/
#define ROUNDED_DIV(A, B) (((A) + ((B) / 2)) / (B))

#ifdef __cplusplus
extern "C" {
#endif
Expand Down

0 comments on commit 06c4d1f

Please sign in to comment.