mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-09 19:05:44 +00:00
move get_Relay_PWM_Count to better file
This commit is contained in:
@ -1540,41 +1540,6 @@ int http_fn_cfg_quick(http_request_t* request) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// @brief Computes the Relay and PWM count.
|
||||
/// @param relayCount Number of relay and LED channels.
|
||||
/// @param pwmCount Number of PWM channels.
|
||||
void get_Relay_PWM_Count(int* relayCount, int* pwmCount, int* dInputCount) {
|
||||
int i;
|
||||
(*relayCount) = 0;
|
||||
(*pwmCount) = 0;
|
||||
(*dInputCount) = 0;
|
||||
|
||||
for (i = 0; i < PLATFORM_GPIO_MAX; i++) {
|
||||
int role = PIN_GetPinRoleForPinIndex(i);
|
||||
switch (role) {
|
||||
case IOR_Relay:
|
||||
case IOR_Relay_n:
|
||||
case IOR_LED:
|
||||
case IOR_LED_n:
|
||||
(*relayCount)++;
|
||||
break;
|
||||
case IOR_PWM:
|
||||
case IOR_PWM_n:
|
||||
(*pwmCount)++;
|
||||
break;
|
||||
case IOR_DigitalInput:
|
||||
case IOR_DigitalInput_n:
|
||||
case IOR_DigitalInput_NoPup:
|
||||
case IOR_DigitalInput_NoPup_n:
|
||||
(*dInputCount)++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void doHomeAssistantDiscovery(const char *topic, http_request_t *request) {
|
||||
int i;
|
||||
int relayCount;
|
||||
|
||||
Reference in New Issue
Block a user