ex

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Committer:
TMBOY
Date:
Tue Jul 18 16:54:45 2017 +0800
Revision:
47:9e361da97763
?

Who changed what in which revision?

UserRevisionLine numberNew contents of line
TMBOY 47:9e361da97763 1 #pragma once
TMBOY 47:9e361da97763 2 #include "rtos.h"
TMBOY 47:9e361da97763 3
TMBOY 47:9e361da97763 4 class SharedBuffer
TMBOY 47:9e361da97763 5 {
TMBOY 47:9e361da97763 6 public:
TMBOY 47:9e361da97763 7 SharedBuffer(unsigned int size);
TMBOY 47:9e361da97763 8 ~SharedBuffer();
TMBOY 47:9e361da97763 9 unsigned int read(unsigned char out[], unsigned int size);
TMBOY 47:9e361da97763 10 unsigned int write(const unsigned char in[], unsigned int size);
TMBOY 47:9e361da97763 11 void wait();
TMBOY 47:9e361da97763 12 private:
TMBOY 47:9e361da97763 13 unsigned int m_nBufferSize;
TMBOY 47:9e361da97763 14 unsigned int m_nWriteOffset;
TMBOY 47:9e361da97763 15 unsigned int m_nDataSize;
TMBOY 47:9e361da97763 16 unsigned char *m_pBuffer;
TMBOY 47:9e361da97763 17 rtos::Semaphore sem_Read;
TMBOY 47:9e361da97763 18 rtos::Semaphore sem_Write;
TMBOY 47:9e361da97763 19 };