mirror of
https://github.com/preble/libpinproc
synced 2026-02-24 18:25:23 +01:00
Implemented PRSwitchGetStates to retrieve the current state of each switch
This commit is contained in:
@@ -84,6 +84,9 @@ void RunLoop(PRHandle proc)
|
||||
unsigned char dots[4*((128*32)/8)];
|
||||
unsigned int dotOffset = 0;
|
||||
|
||||
// Retrieve and store initial switch states.
|
||||
LoadSwitchStates(proc);
|
||||
|
||||
while (runLoopRun)
|
||||
{
|
||||
PRDriverWatchdogTickle(proc);
|
||||
@@ -107,6 +110,7 @@ void RunLoop(PRHandle proc)
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
printf("%d.%03d switch % 3d: %s\n", tv.tv_sec-startTime, tv.tv_usec/1000, event->value, stateText);
|
||||
UpdateSwitchState( event );
|
||||
}
|
||||
PRFlushWriteData(proc);
|
||||
usleep(10*1000); // Sleep for 10ms so we aren't pegging the CPU.
|
||||
|
||||
Reference in New Issue
Block a user