summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author萌新源 <[email protected]>2026-09-21 15:44:01 +0800
committerGitHub <[email protected]>2026-09-21 15:44:01 +0800
commit005d2914925308bad929d4e83a0edc1349c4a1b8 (patch)
tree668f7367669bc6d9a8969b7d8a40fb53dfac8ea9
parent0edbc15ea9bd50c814d4d3eb4c5d87cd4f90e82a (diff)
[bsp/Infineon] Fix PWM macro mismatches left by the CHx_PORTy rename (#11802)
* [bsp/Infineon] Fix PWM macro mismatches left by the CHx_PORTy rename Commit e5382cb733 renamed the PWM table guards in drv_pwm.c to the CHx_PORTy convention but only adapted the psoc6-evk Kconfig, leaving several mismatches behind: - The psoc6-evaluationkit-062S2 slider sample still tested the old flat name BSP_USING_PWM0_PORT0 while the board Kconfig defines BSP_USING_PWM0_CH0_PORT0, so the PWM init was compiled out. - The PORT13 entry was renamed to BSP_USING_PWM0_CH7_PORT13, a macro that no Kconfig defines, and the channel is wrong anyway: PWM0_CH3_PORT13_CONFIG carries .channel = 3, PORT13 sits under the PWM0 CH3 menu, and the slider demo selects CH3 + PORT13. - The PSOC62 template and five psoc6 boards (cy8ckit-062-BLE, cy8ckit-062-WIFI-BT, cy8ckit-062S2-43012, cy8ckit-062s4, cy8cproto-062S3-4343W) still define the old flat names. Fix all of them by migrating the evaluationkit sample to BSP_USING_PWM0_CH0_PORT0 and renaming the PORT13 group to BSP_USING_PWM0_CH3_PORT13 across drv_pwm.c, the PSOC62 template and the five boards' Kconfigs/slider samples, so Kconfig, driver table and samples match again. Note: the sibling guards BSP_USING_PWM0_CH7_PORT2/5/7/9/10/12 are still not generated by these boards' Kconfigs; left untouched for a separate discussion. * style: format code with clang-format [skip ci]
-rw-r--r--bsp/Infineon/libraries/HAL_Drivers/drv_pwm.c13
-rw-r--r--bsp/Infineon/libraries/templates/PSOC62/board/Kconfig4
-rw-r--r--bsp/Infineon/libraries/templates/PSOC62/board/ports/slider_sample.c32
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062-BLE/board/Kconfig4
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062-BLE/board/ports/slider_sample.c32
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/Kconfig4
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/ports/slider_sample.c32
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/Kconfig6
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/ports/slider_sample.c32
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062s4/board/Kconfig4
-rw-r--r--bsp/Infineon/psoc6-cy8ckit-062s4/board/ports/slider_sample.c32
-rw-r--r--bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/Kconfig6
-rw-r--r--bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/ports/slider_sample.c32
-rw-r--r--bsp/Infineon/psoc6-evaluationkit-062S2/board/ports/slider_sample.c32
14 files changed, 125 insertions, 140 deletions
diff --git a/bsp/Infineon/libraries/HAL_Drivers/drv_pwm.c b/bsp/Infineon/libraries/HAL_Drivers/drv_pwm.c
index af7afbde11..53799748e5 100644
--- a/bsp/Infineon/libraries/HAL_Drivers/drv_pwm.c
+++ b/bsp/Infineon/libraries/HAL_Drivers/drv_pwm.c
@@ -29,8 +29,7 @@ struct ifx_pwm
rt_uint8_t gpio;
};
-static struct ifx_pwm ifx_pwm_obj[] =
-{
+static struct ifx_pwm ifx_pwm_obj[] = {
#ifdef BSP_USING_PWM0_CH0_PORT0
PWM0_CH0_PORT0_CONFIG,
#endif
@@ -75,7 +74,7 @@ static struct ifx_pwm ifx_pwm_obj[] =
PWM0_CH7_PORT12_CONFIG,
#endif
-#ifdef BSP_USING_PWM0_CH7_PORT13
+#ifdef BSP_USING_PWM0_CH3_PORT13
PWM0_CH3_PORT13_CONFIG,
#endif
};
@@ -89,12 +88,12 @@ static rt_err_t drv_pwm_enable(cyhal_pwm_t *htim, struct rt_pwm_configuration *c
{
if (!enable)
{
- htim->tcpwm.resource.channel_num = channel;
+ htim->tcpwm.resource.channel_num = channel;
cyhal_pwm_stop(htim);
}
else
{
- htim->tcpwm.resource.channel_num = channel;
+ htim->tcpwm.resource.channel_num = channel;
cyhal_pwm_start(htim);
}
}
@@ -163,7 +162,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg
}
}
-static struct rt_pwm_ops drv_ops = {drv_pwm_control};
+static struct rt_pwm_ops drv_ops = { drv_pwm_control };
static rt_err_t ifx_hw_pwm_init(struct ifx_pwm *device)
{
@@ -218,7 +217,7 @@ __exit:
}
INIT_BOARD_EXPORT(rt_hw_pwm_init);
-#define PWM_DEV_NAME "pwm0"
+#define PWM_DEV_NAME "pwm0"
#define PWM_DEV_CHANNEL 4
struct rt_device_pwm *pwm_dev;
diff --git a/bsp/Infineon/libraries/templates/PSOC62/board/Kconfig b/bsp/Infineon/libraries/templates/PSOC62/board/Kconfig
index a8530c34de..12042f859b 100644
--- a/bsp/Infineon/libraries/templates/PSOC62/board/Kconfig
+++ b/bsp/Infineon/libraries/templates/PSOC62/board/Kconfig
@@ -61,8 +61,8 @@ menu "On-chip Peripheral Drivers"
bool "Enable PWM0 channel3"
default n
if BSP_USING_PWM0_CH3
- config BSP_USING_PWM0_PORT13
- bool "Enable PWM0-PORT13 output pwm"
+ config BSP_USING_PWM0_CH3_PORT13
+ bool "Enable PWM0-CH3-PORT13 output pwm"
default n
endif
menuconfig BSP_USING_PWM0_CH7
diff --git a/bsp/Infineon/libraries/templates/PSOC62/board/ports/slider_sample.c b/bsp/Infineon/libraries/templates/PSOC62/board/ports/slider_sample.c
index 829094f5f2..ed5ccc2013 100644
--- a/bsp/Infineon/libraries/templates/PSOC62/board/ports/slider_sample.c
+++ b/bsp/Infineon/libraries/templates/PSOC62/board/ports/slider_sample.c
@@ -14,16 +14,16 @@
#ifdef BSP_USING_SLIDER
#include "cycfg_capsense.h"
-#define CAPSENSE_INTR_PRIORITY (7u)
-#define EZI2C_INTR_PRIORITY (6u)
+#define CAPSENSE_INTR_PRIORITY (7u)
+#define EZI2C_INTR_PRIORITY (6u)
/* Allowed duty cycle for maximum brightness */
-#define LED_MAX_BRIGHTNESS (100u)
+#define LED_MAX_BRIGHTNESS (100u)
/* Allowed duty cycle for minimum brightness*/
-#define LED_MIN_BRIGHTNESS (0u)
+#define LED_MIN_BRIGHTNESS (0u)
-#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
+#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
typedef enum
{
@@ -40,11 +40,11 @@ typedef struct
static rt_sem_t trans_done_semphr = RT_NULL;
#ifndef RT_USING_PWM
- #error You need enable PWM to use this sample
+#error You need enable PWM to use this sample
#else
- #define PWM_DEV_NAME "pwm0"
- #define PWM_DEV_CHANNEL 3
- static struct rt_device_pwm *pwm_dev;
+#define PWM_DEV_NAME "pwm0"
+#define PWM_DEV_CHANNEL 3
+static struct rt_device_pwm *pwm_dev;
#endif
static void capsense_isr(void)
@@ -68,8 +68,7 @@ static uint32_t initialize_capsense(void)
uint32_t status = CYRET_SUCCESS;
/* CapSense interrupt configuration parameters */
- static const cy_stc_sysint_t capSense_intr_config =
- {
+ static const cy_stc_sysint_t capSense_intr_config = {
.intrSrc = csd_interrupt_IRQn,
.intrPriority = CAPSENSE_INTR_PRIORITY,
};
@@ -127,7 +126,7 @@ void Slider_Init(void)
return;
}
-#ifdef BSP_USING_PWM0_PORT13
+#ifdef BSP_USING_PWM0_CH3_PORT13
/* Initiate PWM*/
pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
@@ -162,20 +161,19 @@ static void process_touch(void)
bool led_update_req = false;
static uint16_t slider_pos_prev;
- static led_data_t led_data = {LED_ON, LED_MAX_BRIGHTNESS};
+ static led_data_t led_data = { LED_ON, LED_MAX_BRIGHTNESS };
/* Get slider status */
slider_touch_info = Cy_CapSense_GetTouchInfo(
- CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
+ CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
slider_touch_status = slider_touch_info->numPosition;
slider_pos = slider_touch_info->ptrPosition->x;
/* Detect the new touch on slider */
if ((RT_NULL != slider_touch_status) &&
- (slider_pos != slider_pos_prev))
+ (slider_pos != slider_pos_prev))
{
- led_data.brightness = (slider_pos * 100)
- / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
+ led_data.brightness = (slider_pos * 100) / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
led_update_req = true;
}
diff --git a/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/Kconfig b/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/Kconfig
index b5e7066949..6d268136a8 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/Kconfig
+++ b/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/Kconfig
@@ -61,8 +61,8 @@ menu "On-chip Peripheral Drivers"
bool "Enable PWM0 channel3"
default n
if BSP_USING_PWM0_CH3
- config BSP_USING_PWM0_PORT13
- bool "Enable PWM0-PORT13 output pwm"
+ config BSP_USING_PWM0_CH3_PORT13
+ bool "Enable PWM0-CH3-PORT13 output pwm"
default n
endif
menuconfig BSP_USING_PWM0_CH7
diff --git a/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/ports/slider_sample.c b/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/ports/slider_sample.c
index 829094f5f2..ed5ccc2013 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/ports/slider_sample.c
+++ b/bsp/Infineon/psoc6-cy8ckit-062-BLE/board/ports/slider_sample.c
@@ -14,16 +14,16 @@
#ifdef BSP_USING_SLIDER
#include "cycfg_capsense.h"
-#define CAPSENSE_INTR_PRIORITY (7u)
-#define EZI2C_INTR_PRIORITY (6u)
+#define CAPSENSE_INTR_PRIORITY (7u)
+#define EZI2C_INTR_PRIORITY (6u)
/* Allowed duty cycle for maximum brightness */
-#define LED_MAX_BRIGHTNESS (100u)
+#define LED_MAX_BRIGHTNESS (100u)
/* Allowed duty cycle for minimum brightness*/
-#define LED_MIN_BRIGHTNESS (0u)
+#define LED_MIN_BRIGHTNESS (0u)
-#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
+#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
typedef enum
{
@@ -40,11 +40,11 @@ typedef struct
static rt_sem_t trans_done_semphr = RT_NULL;
#ifndef RT_USING_PWM
- #error You need enable PWM to use this sample
+#error You need enable PWM to use this sample
#else
- #define PWM_DEV_NAME "pwm0"
- #define PWM_DEV_CHANNEL 3
- static struct rt_device_pwm *pwm_dev;
+#define PWM_DEV_NAME "pwm0"
+#define PWM_DEV_CHANNEL 3
+static struct rt_device_pwm *pwm_dev;
#endif
static void capsense_isr(void)
@@ -68,8 +68,7 @@ static uint32_t initialize_capsense(void)
uint32_t status = CYRET_SUCCESS;
/* CapSense interrupt configuration parameters */
- static const cy_stc_sysint_t capSense_intr_config =
- {
+ static const cy_stc_sysint_t capSense_intr_config = {
.intrSrc = csd_interrupt_IRQn,
.intrPriority = CAPSENSE_INTR_PRIORITY,
};
@@ -127,7 +126,7 @@ void Slider_Init(void)
return;
}
-#ifdef BSP_USING_PWM0_PORT13
+#ifdef BSP_USING_PWM0_CH3_PORT13
/* Initiate PWM*/
pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
@@ -162,20 +161,19 @@ static void process_touch(void)
bool led_update_req = false;
static uint16_t slider_pos_prev;
- static led_data_t led_data = {LED_ON, LED_MAX_BRIGHTNESS};
+ static led_data_t led_data = { LED_ON, LED_MAX_BRIGHTNESS };
/* Get slider status */
slider_touch_info = Cy_CapSense_GetTouchInfo(
- CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
+ CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
slider_touch_status = slider_touch_info->numPosition;
slider_pos = slider_touch_info->ptrPosition->x;
/* Detect the new touch on slider */
if ((RT_NULL != slider_touch_status) &&
- (slider_pos != slider_pos_prev))
+ (slider_pos != slider_pos_prev))
{
- led_data.brightness = (slider_pos * 100)
- / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
+ led_data.brightness = (slider_pos * 100) / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
led_update_req = true;
}
diff --git a/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/Kconfig b/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/Kconfig
index d2331656df..2398aa9f3a 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/Kconfig
+++ b/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/Kconfig
@@ -61,8 +61,8 @@ menu "On-chip Peripheral Drivers"
bool "Enable PWM0 channel3"
default n
if BSP_USING_PWM0_CH3
- config BSP_USING_PWM0_PORT13
- bool "Enable PWM0-PORT13 output pwm"
+ config BSP_USING_PWM0_CH3_PORT13
+ bool "Enable PWM0-CH3-PORT13 output pwm"
default n
endif
menuconfig BSP_USING_PWM0_CH7
diff --git a/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/ports/slider_sample.c b/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/ports/slider_sample.c
index 829094f5f2..ed5ccc2013 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/ports/slider_sample.c
+++ b/bsp/Infineon/psoc6-cy8ckit-062-WIFI-BT/board/ports/slider_sample.c
@@ -14,16 +14,16 @@
#ifdef BSP_USING_SLIDER
#include "cycfg_capsense.h"
-#define CAPSENSE_INTR_PRIORITY (7u)
-#define EZI2C_INTR_PRIORITY (6u)
+#define CAPSENSE_INTR_PRIORITY (7u)
+#define EZI2C_INTR_PRIORITY (6u)
/* Allowed duty cycle for maximum brightness */
-#define LED_MAX_BRIGHTNESS (100u)
+#define LED_MAX_BRIGHTNESS (100u)
/* Allowed duty cycle for minimum brightness*/
-#define LED_MIN_BRIGHTNESS (0u)
+#define LED_MIN_BRIGHTNESS (0u)
-#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
+#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
typedef enum
{
@@ -40,11 +40,11 @@ typedef struct
static rt_sem_t trans_done_semphr = RT_NULL;
#ifndef RT_USING_PWM
- #error You need enable PWM to use this sample
+#error You need enable PWM to use this sample
#else
- #define PWM_DEV_NAME "pwm0"
- #define PWM_DEV_CHANNEL 3
- static struct rt_device_pwm *pwm_dev;
+#define PWM_DEV_NAME "pwm0"
+#define PWM_DEV_CHANNEL 3
+static struct rt_device_pwm *pwm_dev;
#endif
static void capsense_isr(void)
@@ -68,8 +68,7 @@ static uint32_t initialize_capsense(void)
uint32_t status = CYRET_SUCCESS;
/* CapSense interrupt configuration parameters */
- static const cy_stc_sysint_t capSense_intr_config =
- {
+ static const cy_stc_sysint_t capSense_intr_config = {
.intrSrc = csd_interrupt_IRQn,
.intrPriority = CAPSENSE_INTR_PRIORITY,
};
@@ -127,7 +126,7 @@ void Slider_Init(void)
return;
}
-#ifdef BSP_USING_PWM0_PORT13
+#ifdef BSP_USING_PWM0_CH3_PORT13
/* Initiate PWM*/
pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
@@ -162,20 +161,19 @@ static void process_touch(void)
bool led_update_req = false;
static uint16_t slider_pos_prev;
- static led_data_t led_data = {LED_ON, LED_MAX_BRIGHTNESS};
+ static led_data_t led_data = { LED_ON, LED_MAX_BRIGHTNESS };
/* Get slider status */
slider_touch_info = Cy_CapSense_GetTouchInfo(
- CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
+ CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
slider_touch_status = slider_touch_info->numPosition;
slider_pos = slider_touch_info->ptrPosition->x;
/* Detect the new touch on slider */
if ((RT_NULL != slider_touch_status) &&
- (slider_pos != slider_pos_prev))
+ (slider_pos != slider_pos_prev))
{
- led_data.brightness = (slider_pos * 100)
- / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
+ led_data.brightness = (slider_pos * 100) / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
led_update_req = true;
}
diff --git a/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/Kconfig b/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/Kconfig
index e39798ab56..f6ba3eb1bd 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/Kconfig
+++ b/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/Kconfig
@@ -61,8 +61,8 @@ menu "On-chip Peripheral Drivers"
bool "Enable PWM0 channel3"
default n
if BSP_USING_PWM0_CH3
- config BSP_USING_PWM0_PORT13
- bool "Enable PWM0-PORT13 output pwm"
+ config BSP_USING_PWM0_CH3_PORT13
+ bool "Enable PWM0-CH3-PORT13 output pwm"
default n
endif
menuconfig BSP_USING_PWM0_CH7
@@ -270,7 +270,7 @@ menu "Board extended module Drivers"
select BSP_USING_PWM
select BSP_USING_PWM0
select BSP_USING_PWM0_CH3
- select BSP_USING_PWM0_PORT13
+ select BSP_USING_PWM0_CH3_PORT13
default n
endif
diff --git a/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/ports/slider_sample.c b/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/ports/slider_sample.c
index a4599ceaa7..e60a2a8275 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/ports/slider_sample.c
+++ b/bsp/Infineon/psoc6-cy8ckit-062S2-43012/board/ports/slider_sample.c
@@ -14,16 +14,16 @@
#ifdef BSP_USING_SLIDER
#include "cycfg_capsense.h"
-#define CAPSENSE_INTR_PRIORITY (7u)
-#define EZI2C_INTR_PRIORITY (6u)
+#define CAPSENSE_INTR_PRIORITY (7u)
+#define EZI2C_INTR_PRIORITY (6u)
/* Allowed duty cycle for maximum brightness */
-#define LED_MAX_BRIGHTNESS (100u)
+#define LED_MAX_BRIGHTNESS (100u)
/* Allowed duty cycle for minimum brightness*/
-#define LED_MIN_BRIGHTNESS (0u)
+#define LED_MIN_BRIGHTNESS (0u)
-#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
+#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
typedef enum
{
@@ -41,11 +41,11 @@ static rt_sem_t trans_done_semphr = RT_NULL;
static rt_thread_t sld_thread = RT_NULL;
#ifndef RT_USING_PWM
- #error You need enable PWM to use this sample
+#error You need enable PWM to use this sample
#else
- #define PWM_DEV_NAME "pwm0"
- #define PWM_DEV_CHANNEL 3
- static struct rt_device_pwm *pwm_dev;
+#define PWM_DEV_NAME "pwm0"
+#define PWM_DEV_CHANNEL 3
+static struct rt_device_pwm *pwm_dev;
#endif
static void capsense_isr(void)
@@ -69,8 +69,7 @@ static uint32_t initialize_capsense(void)
uint32_t status = CYRET_SUCCESS;
/* CapSense interrupt configuration parameters */
- static const cy_stc_sysint_t capSense_intr_config =
- {
+ static const cy_stc_sysint_t capSense_intr_config = {
.intrSrc = csd_interrupt_IRQn,
.intrPriority = CAPSENSE_INTR_PRIORITY,
};
@@ -128,7 +127,7 @@ void Slider_Init(void)
return;
}
-#ifdef BSP_USING_PWM0_PORT13
+#ifdef BSP_USING_PWM0_CH3_PORT13
/* Initiate PWM*/
pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
@@ -163,20 +162,19 @@ static void process_touch(void)
bool led_update_req = false;
static uint16_t slider_pos_prev;
- static led_data_t led_data = {LED_ON, LED_MAX_BRIGHTNESS};
+ static led_data_t led_data = { LED_ON, LED_MAX_BRIGHTNESS };
/* Get slider status */
slider_touch_info = Cy_CapSense_GetTouchInfo(
- CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
+ CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
slider_touch_status = slider_touch_info->numPosition;
slider_pos = slider_touch_info->ptrPosition->x;
/* Detect the new touch on slider */
if ((RT_NULL != slider_touch_status) &&
- (slider_pos != slider_pos_prev))
+ (slider_pos != slider_pos_prev))
{
- led_data.brightness = (slider_pos * 100)
- / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
+ led_data.brightness = (slider_pos * 100) / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
led_update_req = true;
}
diff --git a/bsp/Infineon/psoc6-cy8ckit-062s4/board/Kconfig b/bsp/Infineon/psoc6-cy8ckit-062s4/board/Kconfig
index 67de175efd..7c83b2a756 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062s4/board/Kconfig
+++ b/bsp/Infineon/psoc6-cy8ckit-062s4/board/Kconfig
@@ -61,8 +61,8 @@ menu "On-chip Peripheral Drivers"
bool "Enable PWM0 channel3"
default n
if BSP_USING_PWM0_CH3
- config BSP_USING_PWM0_PORT13
- bool "Enable PWM0-PORT13 output pwm"
+ config BSP_USING_PWM0_CH3_PORT13
+ bool "Enable PWM0-CH3-PORT13 output pwm"
default n
endif
menuconfig BSP_USING_PWM0_CH7
diff --git a/bsp/Infineon/psoc6-cy8ckit-062s4/board/ports/slider_sample.c b/bsp/Infineon/psoc6-cy8ckit-062s4/board/ports/slider_sample.c
index 829094f5f2..ed5ccc2013 100644
--- a/bsp/Infineon/psoc6-cy8ckit-062s4/board/ports/slider_sample.c
+++ b/bsp/Infineon/psoc6-cy8ckit-062s4/board/ports/slider_sample.c
@@ -14,16 +14,16 @@
#ifdef BSP_USING_SLIDER
#include "cycfg_capsense.h"
-#define CAPSENSE_INTR_PRIORITY (7u)
-#define EZI2C_INTR_PRIORITY (6u)
+#define CAPSENSE_INTR_PRIORITY (7u)
+#define EZI2C_INTR_PRIORITY (6u)
/* Allowed duty cycle for maximum brightness */
-#define LED_MAX_BRIGHTNESS (100u)
+#define LED_MAX_BRIGHTNESS (100u)
/* Allowed duty cycle for minimum brightness*/
-#define LED_MIN_BRIGHTNESS (0u)
+#define LED_MIN_BRIGHTNESS (0u)
-#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
+#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
typedef enum
{
@@ -40,11 +40,11 @@ typedef struct
static rt_sem_t trans_done_semphr = RT_NULL;
#ifndef RT_USING_PWM
- #error You need enable PWM to use this sample
+#error You need enable PWM to use this sample
#else
- #define PWM_DEV_NAME "pwm0"
- #define PWM_DEV_CHANNEL 3
- static struct rt_device_pwm *pwm_dev;
+#define PWM_DEV_NAME "pwm0"
+#define PWM_DEV_CHANNEL 3
+static struct rt_device_pwm *pwm_dev;
#endif
static void capsense_isr(void)
@@ -68,8 +68,7 @@ static uint32_t initialize_capsense(void)
uint32_t status = CYRET_SUCCESS;
/* CapSense interrupt configuration parameters */
- static const cy_stc_sysint_t capSense_intr_config =
- {
+ static const cy_stc_sysint_t capSense_intr_config = {
.intrSrc = csd_interrupt_IRQn,
.intrPriority = CAPSENSE_INTR_PRIORITY,
};
@@ -127,7 +126,7 @@ void Slider_Init(void)
return;
}
-#ifdef BSP_USING_PWM0_PORT13
+#ifdef BSP_USING_PWM0_CH3_PORT13
/* Initiate PWM*/
pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
@@ -162,20 +161,19 @@ static void process_touch(void)
bool led_update_req = false;
static uint16_t slider_pos_prev;
- static led_data_t led_data = {LED_ON, LED_MAX_BRIGHTNESS};
+ static led_data_t led_data = { LED_ON, LED_MAX_BRIGHTNESS };
/* Get slider status */
slider_touch_info = Cy_CapSense_GetTouchInfo(
- CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
+ CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
slider_touch_status = slider_touch_info->numPosition;
slider_pos = slider_touch_info->ptrPosition->x;
/* Detect the new touch on slider */
if ((RT_NULL != slider_touch_status) &&
- (slider_pos != slider_pos_prev))
+ (slider_pos != slider_pos_prev))
{
- led_data.brightness = (slider_pos * 100)
- / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
+ led_data.brightness = (slider_pos * 100) / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
led_update_req = true;
}
diff --git a/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/Kconfig b/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/Kconfig
index 2ce35dc704..7b6f79b46f 100644
--- a/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/Kconfig
+++ b/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/Kconfig
@@ -61,8 +61,8 @@ menu "On-chip Peripheral Drivers"
bool "Enable PWM0 channel3"
default n
if BSP_USING_PWM0_CH3
- config BSP_USING_PWM0_PORT13
- bool "Enable PWM0-PORT13 output pwm"
+ config BSP_USING_PWM0_CH3_PORT13
+ bool "Enable PWM0-CH3-PORT13 output pwm"
default n
endif
menuconfig BSP_USING_PWM0_CH7
@@ -270,7 +270,7 @@ menu "Board extended module Drivers"
select BSP_USING_PWM
select BSP_USING_PWM0
select BSP_USING_PWM0_CH3
- select BSP_USING_PWM0_PORT13
+ select BSP_USING_PWM0_CH3_PORT13
default n
endif
diff --git a/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/ports/slider_sample.c b/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/ports/slider_sample.c
index a4599ceaa7..e60a2a8275 100644
--- a/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/ports/slider_sample.c
+++ b/bsp/Infineon/psoc6-cy8cproto-062S3-4343W/board/ports/slider_sample.c
@@ -14,16 +14,16 @@
#ifdef BSP_USING_SLIDER
#include "cycfg_capsense.h"
-#define CAPSENSE_INTR_PRIORITY (7u)
-#define EZI2C_INTR_PRIORITY (6u)
+#define CAPSENSE_INTR_PRIORITY (7u)
+#define EZI2C_INTR_PRIORITY (6u)
/* Allowed duty cycle for maximum brightness */
-#define LED_MAX_BRIGHTNESS (100u)
+#define LED_MAX_BRIGHTNESS (100u)
/* Allowed duty cycle for minimum brightness*/
-#define LED_MIN_BRIGHTNESS (0u)
+#define LED_MIN_BRIGHTNESS (0u)
-#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
+#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
typedef enum
{
@@ -41,11 +41,11 @@ static rt_sem_t trans_done_semphr = RT_NULL;
static rt_thread_t sld_thread = RT_NULL;
#ifndef RT_USING_PWM
- #error You need enable PWM to use this sample
+#error You need enable PWM to use this sample
#else
- #define PWM_DEV_NAME "pwm0"
- #define PWM_DEV_CHANNEL 3
- static struct rt_device_pwm *pwm_dev;
+#define PWM_DEV_NAME "pwm0"
+#define PWM_DEV_CHANNEL 3
+static struct rt_device_pwm *pwm_dev;
#endif
static void capsense_isr(void)
@@ -69,8 +69,7 @@ static uint32_t initialize_capsense(void)
uint32_t status = CYRET_SUCCESS;
/* CapSense interrupt configuration parameters */
- static const cy_stc_sysint_t capSense_intr_config =
- {
+ static const cy_stc_sysint_t capSense_intr_config = {
.intrSrc = csd_interrupt_IRQn,
.intrPriority = CAPSENSE_INTR_PRIORITY,
};
@@ -128,7 +127,7 @@ void Slider_Init(void)
return;
}
-#ifdef BSP_USING_PWM0_PORT13
+#ifdef BSP_USING_PWM0_CH3_PORT13
/* Initiate PWM*/
pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
@@ -163,20 +162,19 @@ static void process_touch(void)
bool led_update_req = false;
static uint16_t slider_pos_prev;
- static led_data_t led_data = {LED_ON, LED_MAX_BRIGHTNESS};
+ static led_data_t led_data = { LED_ON, LED_MAX_BRIGHTNESS };
/* Get slider status */
slider_touch_info = Cy_CapSense_GetTouchInfo(
- CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
+ CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
slider_touch_status = slider_touch_info->numPosition;
slider_pos = slider_touch_info->ptrPosition->x;
/* Detect the new touch on slider */
if ((RT_NULL != slider_touch_status) &&
- (slider_pos != slider_pos_prev))
+ (slider_pos != slider_pos_prev))
{
- led_data.brightness = (slider_pos * 100)
- / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
+ led_data.brightness = (slider_pos * 100) / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
led_update_req = true;
}
diff --git a/bsp/Infineon/psoc6-evaluationkit-062S2/board/ports/slider_sample.c b/bsp/Infineon/psoc6-evaluationkit-062S2/board/ports/slider_sample.c
index cc7931fa57..3fe4f1fecd 100644
--- a/bsp/Infineon/psoc6-evaluationkit-062S2/board/ports/slider_sample.c
+++ b/bsp/Infineon/psoc6-evaluationkit-062S2/board/ports/slider_sample.c
@@ -14,16 +14,16 @@
#ifdef BSP_USING_SLIDER
#include "cycfg_capsense.h"
-#define CAPSENSE_INTR_PRIORITY (7u)
-#define EZI2C_INTR_PRIORITY (6u)
+#define CAPSENSE_INTR_PRIORITY (7u)
+#define EZI2C_INTR_PRIORITY (6u)
/* Allowed duty cycle for maximum brightness */
-#define LED_MAX_BRIGHTNESS (100u)
+#define LED_MAX_BRIGHTNESS (100u)
/* Allowed duty cycle for minimum brightness*/
-#define LED_MIN_BRIGHTNESS (0u)
+#define LED_MIN_BRIGHTNESS (0u)
-#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
+#define GET_DUTY_CYCLE(x) (1 * 1000 * 1000 - x * 10 * 1000)
typedef enum
{
@@ -41,11 +41,11 @@ static rt_sem_t trans_done_semphr = RT_NULL;
static rt_thread_t sld_thread = RT_NULL;
#ifndef RT_USING_PWM
- #error You need enable PWM to use this sample
+#error You need enable PWM to use this sample
#else
- #define PWM_DEV_NAME "pwm0"
- #define PWM_DEV_CHANNEL 0
- static struct rt_device_pwm *pwm_dev;
+#define PWM_DEV_NAME "pwm0"
+#define PWM_DEV_CHANNEL 0
+static struct rt_device_pwm *pwm_dev;
#endif
static void capsense_isr(void)
@@ -69,8 +69,7 @@ static uint32_t initialize_capsense(void)
uint32_t status = CYRET_SUCCESS;
/* CapSense interrupt configuration parameters */
- static const cy_stc_sysint_t capSense_intr_config =
- {
+ static const cy_stc_sysint_t capSense_intr_config = {
.intrSrc = csd_interrupt_IRQn,
.intrPriority = CAPSENSE_INTR_PRIORITY,
};
@@ -128,7 +127,7 @@ void Slider_Init(void)
return;
}
-#ifdef BSP_USING_PWM0_PORT0
+#ifdef BSP_USING_PWM0_CH0_PORT0
/* Initiate PWM*/
pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
@@ -163,20 +162,19 @@ static void process_touch(void)
bool led_update_req = false;
static uint16_t slider_pos_prev;
- static led_data_t led_data = {LED_ON, LED_MAX_BRIGHTNESS};
+ static led_data_t led_data = { LED_ON, LED_MAX_BRIGHTNESS };
/* Get slider status */
slider_touch_info = Cy_CapSense_GetTouchInfo(
- CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
+ CY_CAPSENSE_LINEARSLIDER0_WDGT_ID, &cy_capsense_context);
slider_touch_status = slider_touch_info->numPosition;
slider_pos = slider_touch_info->ptrPosition->x;
/* Detect the new touch on slider */
if ((RT_NULL != slider_touch_status) &&
- (slider_pos != slider_pos_prev))
+ (slider_pos != slider_pos_prev))
{
- led_data.brightness = (slider_pos * 100)
- / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
+ led_data.brightness = (slider_pos * 100) / cy_capsense_context.ptrWdConfig[CY_CAPSENSE_LINEARSLIDER0_WDGT_ID].xResolution;
led_update_req = true;
}