-
-
Notifications
You must be signed in to change notification settings - Fork 212
/
Copy path0043-RP2040-PWM-fix-asserts.patch
42 lines (35 loc) · 1.2 KB
/
0043-RP2040-PWM-fix-asserts.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 319315691c1ca8eb564f23d6744712a3efc10230 Mon Sep 17 00:00:00 2001
From: Martino Facchin <m.facchin@arduino.cc>
Date: Mon, 15 Mar 2021 14:53:31 +0100
Subject: [PATCH 043/204] RP2040: PWM: fix asserts
---
targets/TARGET_RASPBERRYPI/TARGET_RP2040/pwmout_api.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pwmout_api.c b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pwmout_api.c
index 5f5d847995..cc2b935bc7 100644
--- a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pwmout_api.c
+++ b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pwmout_api.c
@@ -43,6 +43,7 @@
#include "pinmap.h"
#include "hardware/pwm.h"
#include "hardware/clocks.h"
+#include "mbed_assert.h"
const uint count_top = 1000;
@@ -53,7 +54,7 @@ const uint count_top = 1000;
*/
void pwmout_init(pwmout_t *obj, PinName pin)
{
- MBED_ASSERT(obj);
+ MBED_ASSERT(obj != NULL);
/* Populate PWM object with default values. */
obj->slice = pwm_gpio_to_slice_num(pin);
@@ -75,7 +76,7 @@ void pwmout_init(pwmout_t *obj, PinName pin)
*/
void pwmout_free(pwmout_t *obj)
{
- MBED_ASSERT(obj);
+ MBED_ASSERT(obj != NULL);
pwm_set_enabled(obj->slice, false);
}
--
2.39.1