mirror of
https://github.com/preble/libpinproc
synced 2026-02-24 18:25:23 +01:00
Added driver group disable helper functions.
This commit is contained in:
@@ -225,6 +225,13 @@ PR_EXPORT PRResult PRDriverUpdateState(PRHandle handle, PRDriverState *driverSta
|
|||||||
*/
|
*/
|
||||||
PR_EXPORT PRResult PRDriverLoadMachineTypeDefaults(PRHandle handle, PRMachineType machineType);
|
PR_EXPORT PRResult PRDriverLoadMachineTypeDefaults(PRHandle handle, PRMachineType machineType);
|
||||||
|
|
||||||
|
// Driver Group Helper functions:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disables (turns off) the given driver group.
|
||||||
|
* This function is provided for convenience. See PRDriverGroupDisable() for a full description.
|
||||||
|
*/
|
||||||
|
PR_EXPORT PRResult PRDriverGroupDisable(PRHandle handle, uint8_t groupNum);
|
||||||
// Driver Helper functions:
|
// Driver Helper functions:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -281,6 +288,11 @@ PR_EXPORT void PRDriverAuxPrepareDisable(PRDriverAuxCommand *auxCommand);
|
|||||||
/** Tickle the watchdog timer. */
|
/** Tickle the watchdog timer. */
|
||||||
PR_EXPORT PRResult PRDriverWatchdogTickle(PRHandle handle);
|
PR_EXPORT PRResult PRDriverWatchdogTickle(PRHandle handle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes the given #PRDriverGroupConfig to reflect a disabled group.
|
||||||
|
* @note The driver group config structure must be applied using PRDriverUpdateGroupConfig() to have any effect.
|
||||||
|
*/
|
||||||
|
PR_EXPORT void PRDriverGroupStateDisable(PRDriverGroupConfig *driverGroup);
|
||||||
/**
|
/**
|
||||||
* Changes the given #PRDriverState to reflect a disabled state.
|
* Changes the given #PRDriverState to reflect a disabled state.
|
||||||
* @note The driver state structure must be applied using PRDriverUpdateState() or linked to a switch rule using PRSwitchUpdateRule() to have any effect.
|
* @note The driver state structure must be applied using PRDriverUpdateState() or linked to a switch rule using PRSwitchUpdateRule() to have any effect.
|
||||||
|
|||||||
@@ -166,6 +166,14 @@ PR_EXPORT PRResult PRDriverLoadMachineTypeDefaults(PRHandle handle, PRMachineTyp
|
|||||||
return handleAsDevice->DriverLoadMachineTypeDefaults(machineType);
|
return handleAsDevice->DriverLoadMachineTypeDefaults(machineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Driver Group Helper functions:
|
||||||
|
PR_EXPORT PRResult PRDriverGroupDisable(PRHandle handle, uint8_t groupNum)
|
||||||
|
{
|
||||||
|
PRDriverGroupConfig driverGroup;
|
||||||
|
handleAsDevice->DriverGetGroupConfig(groupNum, &driverGroup);
|
||||||
|
PRDriverGroupStateDisable(&driverGroup);
|
||||||
|
return handleAsDevice->DriverUpdateGroupConfig(&driverGroup);
|
||||||
|
}
|
||||||
// Driver Helper functions:
|
// Driver Helper functions:
|
||||||
PR_EXPORT PRResult PRDriverDisable(PRHandle handle, uint16_t driverNum)
|
PR_EXPORT PRResult PRDriverDisable(PRHandle handle, uint16_t driverNum)
|
||||||
{
|
{
|
||||||
@@ -253,6 +261,10 @@ PR_EXPORT PRResult PRDriverWatchdogTickle(PRHandle handle)
|
|||||||
return handleAsDevice->DriverWatchdogTickle();
|
return handleAsDevice->DriverWatchdogTickle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PR_EXPORT void PRDriverGroupStateDisable(PRDriverGroupConfig *driverGroup)
|
||||||
|
{
|
||||||
|
driverGroup->active = false;
|
||||||
|
}
|
||||||
PR_EXPORT void PRDriverStateDisable(PRDriverState *driver)
|
PR_EXPORT void PRDriverStateDisable(PRDriverState *driver)
|
||||||
{
|
{
|
||||||
driver->state = 0;
|
driver->state = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user