BlinkenArea - GitList
Repositories
Blog
Wiki
flaneth
Code
Commits
Branches
Tags
Search
Tree:
28c2376
Branches
Tags
master
flaneth
firmware
mcuf_in.c
implement MCUF input via Ethernet
Stefan Schuermans
commited
28c2376
at 2019-05-01 21:00:49
mcuf_in.c
Blame
History
Raw
/* flaneth - flash and ethernet Copyright (C) 2007-2012 Stefan Schuermans <stefan@blinkenarea.org> Copyleft: GNU public license V2 - http://www.gnu.org/copyleft/gpl.html a BlinkenArea project - http://www.blinkenarea.org/ */ #include "mcuf_in.h" #include "ser115200.h" #define MCUF_IN_TIMEOUT 25 // 25 * 200ms = 5s static unsigned int McufInTimeout = 0; // check if MCUF input is active int McufInIsActive(void) { return McufInTimeout > 0; // MCUF input active if timeout is greater zero } // tick procedure - call every 200ms void McufInTick200(void) { // time out active MCUF input after 5s if (McufInTimeout > 0) { --McufInTimeout; } } // process a received MCUF packet void McufInRecv(unsigned char *pData, unsigned short Length) { McufInTimeout = MCUF_IN_TIMEOUT; // MCUF input is active now Ser115200Send(pData, Length); }