Skip to content

Commit b1537a5

Browse files
committed
stmhal/mphalport: Change pin obj type to const pointer, to avoid casts.
1 parent bcf60b4 commit b1537a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stmhal/mphalport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ void mp_hal_set_interrupt_char(int c); // -1 to disable
4343

4444
// C-level pin HAL
4545
#include "stmhal/pin.h"
46-
#define mp_hal_pin_obj_t pin_obj_t*
47-
#define mp_hal_get_pin_obj(o) (pin_obj_t*)pin_find(o)
46+
#define mp_hal_pin_obj_t const pin_obj_t*
47+
#define mp_hal_get_pin_obj(o) pin_find(o)
4848
#define mp_hal_pin_input(p) mp_hal_gpio_config((p)->gpio, (p)->pin, 0, 0, 0)
4949
#define mp_hal_pin_output(p) mp_hal_gpio_config((p)->gpio, (p)->pin, 1, 0, 0)
5050
#define mp_hal_pin_open_drain(p) mp_hal_gpio_config((p)->gpio, (p)->pin, 5, 0, 0)

0 commit comments

Comments
 (0)