Skip to content

Commit

Permalink
Fixes for PR 2046 (SPI transaction hooks) (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark9064 authored May 3, 2024
1 parent 5ad8c03 commit 1fb70a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion InfiniTime
Submodule InfiniTime updated 73 files
+32 −0 .devcontainer.json
+0 −66 .devcontainer/Dockerfile
+0 −87 .devcontainer/build.sh
+0 −2 .devcontainer/build_app.sh
+0 −3 .devcontainer/create_build_openocd.sh
+0 −38 .devcontainer/devcontainer.json
+0 −2 .devcontainer/make_build_dir.sh
+21 −1 .vscode/c_cpp_properties.json
+6 −0 .vscode/cmake-kits.json
+32 −13 .vscode/launch.json
+13 −2 .vscode/settings.json
+0 −22 .vscode/tasks.json
+1 −1 README.md
+2 −2 bootloader/ota-dfu-python/README.md
+2 −0 doc/MotionService.md
+1 −1 doc/buildWithVScode.md
+4 −4 doc/code/Apps.md
+0 −0 doc/usingDevcontainers.md
+10 −0 docker/Dockerfile
+1 −2 src/CMakeLists.txt
+1 −0 src/FreeRTOSConfig.h
+2 −0 src/components/ble/DfuService.cpp
+1 −1 src/components/ble/HeartRateService.h
+13 −0 src/components/ble/SimpleWeatherService.cpp
+4 −0 src/components/ble/SimpleWeatherService.h
+2 −2 src/components/datetime/DateTimeController.cpp
+1 −1 src/components/datetime/DateTimeController.h
+0 −196 src/components/gfx/Gfx.cpp
+0 −62 src/components/gfx/Gfx.h
+18 −6 src/components/motion/MotionController.cpp
+5 −3 src/components/motion/MotionController.h
+3 −6 src/displayapp/DisplayApp.cpp
+2 −11 src/displayapp/DisplayAppRecovery.cpp
+0 −1 src/displayapp/DisplayAppRecovery.h
+0 −5 src/displayapp/LittleVgl.cpp
+2 −2 src/displayapp/apps/Apps.h.in
+1 −1 src/displayapp/apps/CMakeLists.txt
+1 −1 src/displayapp/fonts/README.md
+3 −3 src/displayapp/fonts/fonts.json
+1 −1 src/displayapp/screens/Alarm.h
+7 −3 src/displayapp/screens/HeartRate.cpp
+4 −4 src/displayapp/screens/Motion.cpp
+1 −0 src/displayapp/screens/Symbols.h
+1 −1 src/displayapp/screens/WatchFaceAnalog.cpp
+1 −2 src/displayapp/screens/WatchFaceAnalog.h
+1 −1 src/displayapp/screens/WatchFaceCasioStyleG7710.cpp
+1 −2 src/displayapp/screens/WatchFaceCasioStyleG7710.h
+39 −2 src/displayapp/screens/WatchFaceDigital.cpp
+11 −8 src/displayapp/screens/WatchFaceDigital.h
+3 −2 src/displayapp/screens/WatchFaceInfineat.cpp
+1 −2 src/displayapp/screens/WatchFaceInfineat.h
+1 −1 src/displayapp/screens/WatchFaceTerminal.cpp
+1 −2 src/displayapp/screens/WatchFaceTerminal.h
+198 −0 src/displayapp/screens/Weather.cpp
+56 −0 src/displayapp/screens/Weather.h
+25 −0 src/displayapp/screens/WeatherSymbols.cpp
+1 −0 src/displayapp/screens/WeatherSymbols.h
+3 −3 src/displayapp/screens/settings/SettingBluetooth.cpp
+1 −0 src/displayapp/screens/settings/SettingBluetooth.h
+20 −2 src/drivers/Bma421.cpp
+1 −0 src/drivers/Bma421.h
+1 −1 src/drivers/Hrs3300.cpp
+2 −2 src/drivers/Spi.cpp
+2 −1 src/drivers/Spi.h
+7 −15 src/drivers/SpiMaster.cpp
+2 −2 src/drivers/SpiMaster.h
+1 −1 src/drivers/SpiNorFlash.cpp
+60 −41 src/drivers/St7789.cpp
+10 −4 src/drivers/St7789.h
+1 −4 src/heartratetask/HeartRateTask.cpp
+3 −1 src/libs/lv_conf.h
+0 −5 src/recoveryLoader.cpp
+9 −4 src/systemtask/SystemTask.cpp
2 changes: 1 addition & 1 deletion sim/drivers/SpiMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void SpiMaster::OnStartedEvent() {
// spiBaseAddress->EVENTS_END = 0;
//}

bool SpiMaster::Write(uint8_t pinCsn, const uint8_t* data, size_t size) {
bool SpiMaster::Write(uint8_t pinCsn, const uint8_t* data, size_t size, const std::function<void()>& preTransactionHook) {
// if (data == nullptr)
// return false;
// auto ok = xSemaphoreTake(mutex, portMAX_DELAY);
Expand Down
3 changes: 2 additions & 1 deletion sim/drivers/SpiMaster.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <functional>

#include <FreeRTOS.h>
//#include <semphr.h>
Expand Down Expand Up @@ -30,7 +31,7 @@ namespace Pinetime {
SpiMaster& operator=(SpiMaster&&) = delete;

bool Init();
bool Write(uint8_t pinCsn, const uint8_t* data, size_t size);
bool Write(uint8_t pinCsn, const uint8_t* data, size_t size, const std::function<void()>& preTransactionHook);
bool Read(uint8_t pinCsn, uint8_t* cmd, size_t cmdSize, uint8_t* data, size_t dataSize);

bool WriteCmdAndBuffer(uint8_t pinCsn, const uint8_t* cmd, size_t cmdSize, const uint8_t* data, size_t dataSize);
Expand Down

0 comments on commit 1fb70a2

Please sign in to comment.