diff options
author | Karel Gardas <karel@functional.vision> | 2023-02-11 20:58:55 +0100 |
---|---|---|
committer | Karel Gardas <karel@functional.vision> | 2023-02-18 23:00:05 +0100 |
commit | 673d7861e349ceec1b5bd0bf81fa449a6fc9507e (patch) | |
tree | 80c63d76542a11930fd603bf8c76a7f4fea4fe2e | |
parent | 4600dd1d2fab810f5d028b6980138fc6f6aa42ed (diff) |
bsps/beagle: fix warning on possibly uninitialized clock control in pwmss.
-rw-r--r-- | bsps/arm/beagle/pwmss/pwmss.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bsps/arm/beagle/pwmss/pwmss.c b/bsps/arm/beagle/pwmss/pwmss.c index 0fde3db5a9..f3aaf8fc3f 100644 --- a/bsps/arm/beagle/pwmss/pwmss.c +++ b/bsps/arm/beagle/pwmss/pwmss.c @@ -38,7 +38,7 @@ #include <bsp.h> #include <bsp/pwmss.h> #include <bsp/beagleboneblack.h> - +#include <rtems/error.h> /** * @brief This function configures the L3 and L4_PER system clocks. @@ -56,7 +56,10 @@ */ rtems_status_code pwmss_module_clk_config(BBB_PWMSS pwmss_id) { - uint32_t clkctrl; + /* we initialize clkctrl here to nonsentical value as this is going + * to be assigned later anyway. Here assigning 0 is just to kill + * warning emitted by the C compiler. */ + uint32_t clkctrl = 0; /* calculate the address of the clock control register for the PWMSS * module we are configuring */ @@ -66,6 +69,9 @@ rtems_status_code pwmss_module_clk_config(BBB_PWMSS pwmss_id) clkctrl = AM335X_CM_PER_ADDR + AM335X_CM_PER_EPWMSS1_CLKCTRL; } else if(pwmss_id == BBB_PWMSS2) { clkctrl = AM335X_CM_PER_ADDR + AM335X_CM_PER_EPWMSS2_CLKCTRL; + } else { + /* wrong clock configuration, let's panic here. */ + rtems_error(RTEMS_ERROR_PANIC, "beagle: unsupported pwmss module clock configuration value!"); } /* when the module is functional the IDLEST bits (16 -17) of the |