HsUsart renamed to PacketUsart, volatile usage review
This commit is contained in:
parent
7cdc79c2ac
commit
23a75f43c7
12 changed files with 179 additions and 171 deletions
|
@ -32,17 +32,17 @@ public:
|
|||
friend class CrcHandler;
|
||||
public:
|
||||
struct CrcTask {
|
||||
void const * volatile m_address; // changed to nullptr when execution starts
|
||||
uint16_t volatile m_wordCount;
|
||||
ICallback *m_callback;
|
||||
uintptr_t m_callbackParam;
|
||||
void const * m_address; // changed to nullptr when execution starts
|
||||
uint16_t m_wordCount;
|
||||
ICallback *m_callback;
|
||||
uintptr_t m_callbackParam;
|
||||
};
|
||||
|
||||
private:
|
||||
SlotBase *m_next = nullptr;
|
||||
SlotBase volatile *m_next = nullptr;
|
||||
uint8_t m_taskCount;
|
||||
|
||||
virtual CrcTask& operator[](int index) = 0;
|
||||
virtual CrcTask volatile & operator[](int index) volatile = 0;
|
||||
|
||||
protected:
|
||||
SlotBase(unsigned int taskCount) : m_taskCount(taskCount) {}
|
||||
|
@ -54,7 +54,7 @@ public:
|
|||
{
|
||||
public:
|
||||
Slot() : SlotBase(n) {}
|
||||
virtual CrcTask& operator[](int index) { return m_tasks[index]; }
|
||||
virtual CrcTask volatile & operator[](int index) volatile { return m_tasks[index]; }
|
||||
|
||||
private:
|
||||
Slot::CrcTask m_tasks[n];
|
||||
|
@ -68,7 +68,7 @@ public:
|
|||
bool IsQueued(SlotBase &slot, uint8_t task) const;
|
||||
bool IsRunning(SlotBase &slot, uint8_t task) const;
|
||||
|
||||
void DmaTransferCompleted(void);
|
||||
void DmaTransferCompleted(void);
|
||||
|
||||
private:
|
||||
CrcHandler(DMA_TypeDef *dma, uint32_t stream);
|
||||
|
@ -77,10 +77,10 @@ private:
|
|||
void StartNextTask(void);
|
||||
void WaitResults(SlotBase &slot, uint8_t task) const;
|
||||
|
||||
DmaHelper m_dma;
|
||||
SlotBase * volatile m_firstSlot = nullptr;
|
||||
SlotBase * volatile m_activeSlot = nullptr;
|
||||
int volatile m_activeTask;
|
||||
DmaHelper m_dma;
|
||||
SlotBase volatile *m_firstSlot = nullptr;
|
||||
SlotBase volatile *m_activeSlot = nullptr;
|
||||
int volatile m_activeTask;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue