From 94aae1fadb59d3dc5d381ae02b0e85bf297ea328 Mon Sep 17 00:00:00 2001 From: openshwprojects Date: Sat, 16 Apr 2022 15:55:44 +0200 Subject: [PATCH] on bl602, any pi ncan be pwm --- src/httpserver/http_fns.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/httpserver/http_fns.c b/src/httpserver/http_fns.c index 33058e4d1..ed61c4b83 100644 --- a/src/httpserver/http_fns.c +++ b/src/httpserver/http_fns.c @@ -1036,16 +1036,24 @@ int http_fn_cfg_pins(http_request_t *request) { } // strcat(outbuf,""); poststr(request,"
"); - for( i = 0; i < GPIO_MAX; i++) { + for(i = 0; i < GPIO_MAX; i++) { int si, ch, ch2; int j; +#if PLATFORM_BL602 + // On BL602, any GPIO can be mapped to one of 5 PWM channels +#else int internalPWMIndex; +#endif si = PIN_GetPinRoleForPinIndex(i); ch = PIN_GetPinChannelForPinIndex(i); ch2 = PIN_GetPinChannel2ForPinIndex(i); +#if PLATFORM_BL602 + // On BL602, any GPIO can be mapped to one of 5 PWM channels +#else // internal pwm index (-1 if this pin is not supported by pwm) internalPWMIndex = PIN_GetPWMIndexForPinIndex(i); +#endif #if PLATFORM_XR809 poststr(request,PIN_GetPinNameAlias(i)); @@ -1055,12 +1063,16 @@ int http_fn_cfg_pins(http_request_t *request) { #endif hprintf128(request, "