Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
LineHub.cpp
00001 #include "mbed.h" 00002 #include "LineHub.h" 00003 #include "../../../CommonLibraries/RingBuffer/RingBuffer.h" 00004 #include "../../../System/Process/Process.h" 00005 #include "../../../System/Using.h" 00006 00007 static char RS485Line[RS485_BUFFER_LINE]; 00008 RINGBUFFER::RingBuffer RS485LineBuffer = RINGBUFFER::RingBuffer(RS485Line, RS485_BUFFER_LINE); 00009 00010 int lineData[8]; 00011 00012 namespace LINEHUB { 00013 00014 00015 void LineHub::Initialize() { 00016 for(int i = 0; i < 8; i++) { 00017 lineData[i] = 0; 00018 } 00019 00020 } 00021 00022 void LineHub::Update() { 00023 if(RS485LineBuffer.IsFullup()) { 00024 for(int i = 0; i < 8; i++) { 00025 lineData[i] = (int)RS485LineBuffer.GetData(); 00026 } 00027 } 00028 } 00029 00030 int LineHub::GetPara(int num) { 00031 return lineData[num]; 00032 } 00033 }
Generated on Sat Jul 30 2022 20:08:28 by
1.7.2