Pacemaker code Implementation for SFWRENG 3K04
Dependencies: FXOS8700Q Queue mbed-rtos mbed
Fork of Pacemaker by
dataStruct.cpp
- Committer:
- FiveDollar
- Date:
- 2016-11-29
- Revision:
- 30:0cb4890910cd
- Parent:
- 29:c0d63940b0c7
File content as of revision 30:0cb4890910cd:
#pragma once #include "dataStruct.h" #include "rtos.h" #include "mbed.h" void dataStruct(hardware* hWare){ //,thread(&dataStruct::threadStarter){ myHardware = hWare; // thread.signal_set(START_THREAD); } //void threadStarter(void const *p){ // dataStruct *instance = (dataStruct*)p; // instance->storeData(); // } void storeData(){ // thread.signal_wait(START_THREAD); while(true){ streamValue = io->getSense(); if(myQueue.GetNumberOfItems() <= N){ myQueue.Put(&streamValue); } Thread::wait(4); } } queue getData(){ queue temp = myQueue; myQueue.Flush(); return temp; }