Skip to content

Commit a19a3d9

Browse files
committed
RP2040: PWM: fix asserts
1 parent 6c1d95f commit a19a3d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

targets/TARGET_RASPBERRYPI/TARGET_RP2040/pwmout_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "pinmap.h"
4444
#include "hardware/pwm.h"
4545
#include "hardware/clocks.h"
46+
#include "mbed_assert.h"
4647

4748
const uint count_top = 1000;
4849

@@ -53,7 +54,7 @@ const uint count_top = 1000;
5354
*/
5455
void pwmout_init(pwmout_t *obj, PinName pin)
5556
{
56-
MBED_ASSERT(obj);
57+
MBED_ASSERT(obj != NULL);
5758

5859
/* Populate PWM object with default values. */
5960
obj->slice = pwm_gpio_to_slice_num(pin);
@@ -75,7 +76,7 @@ void pwmout_init(pwmout_t *obj, PinName pin)
7576
*/
7677
void pwmout_free(pwmout_t *obj)
7778
{
78-
MBED_ASSERT(obj);
79+
MBED_ASSERT(obj != NULL);
7980
pwm_set_enabled(obj->slice, false);
8081
}
8182

0 commit comments

Comments
 (0)