1
0
mirror of https://github.com/preble/libpinproc synced 2026-02-24 18:25:23 +01:00

Added new PRSwitchesUpdateSwitch() call, removed old PRSwitchesUpdateSwitches(). Added maintaining switch rules in memory. Fixed license formatting in README.markdown.

This commit is contained in:
Adam Preble
2009-05-20 20:17:00 -04:00
parent 62d3176463
commit c46d928ee3
8 changed files with 139 additions and 73 deletions

View File

@@ -101,23 +101,14 @@ void ConfigureSwitches(PRHandle proc)
{
int i;
// Create a basic driver for all of the switches to default to:
PRDriverState defaultDriver;
memset(&defaultDriver, 0x0, sizeof(defaultDriver)); // Set all fields to 0.
for (i = 0; i <= kPRSwitchPhysicalLast; i++)
{
PRSwitchRule sw;
sw.switchNum = i;
sw.notifyHost = true;
sw.changeOutput = false;
sw.linkActive = false;
sw.linkAddress = 0;
sw.eventType = kPREventTypeSwitchClosedDebounced;
sw.driver = defaultDriver;
PRSwitchesUpdateRules(proc, &sw, 1);
PRSwitchesUpdateRule(proc, i, &sw, NULL, 0);
sw.eventType = kPREventTypeSwitchOpenDebounced;
PRSwitchesUpdateRules(proc, &sw, 1);
PRSwitchesUpdateRule(proc, i, &sw, NULL, 0);
}
}