Fix race conditions on SPI and integrate the SPI NOR Flash driver into DFUService (WIP)

This commit is contained in:
JF
2020-05-11 18:50:37 +02:00
parent 0b8e6c3fa2
commit ee05577dd6
12 changed files with 257 additions and 48 deletions

View File

@@ -8,17 +8,22 @@ namespace Pinetime {
namespace System {
class SystemTask;
}
namespace Drivers {
class SpiNorFlash;
}
namespace Controllers {
class Ble;
class DfuService {
public:
DfuService(Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::Ble& bleController);
DfuService(Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::Ble& bleController,
Pinetime::Drivers::SpiNorFlash& spiNorFlash);
void Init();
int OnServiceData(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context);
private:
Pinetime::System::SystemTask& systemTask;
Pinetime::Controllers::Ble& bleController;
Pinetime::Drivers::SpiNorFlash& spiNorFlash;
static constexpr uint16_t dfuServiceId {0x1530};
static constexpr uint16_t packetCharacteristicId {0x1532};