Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
624738ca
Commit
624738ca
authored
Apr 22, 2016
by
Damien George
Browse files
extmod/machine_i2c: Allow mp_hal_pin_obj_t to be any type, not a ptr.
parent
109990fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
esp8266/esp_mphal.h
View file @
624738ca
...
...
@@ -63,7 +63,7 @@ void ets_event_poll(void);
#include "etshal.h"
#include "gpio.h"
#include "esp8266/modpyb.h"
#define mp_hal_pin_obj_t pyb_pin_obj_t
#define mp_hal_pin_obj_t pyb_pin_obj_t
*
#define mp_hal_get_pin_obj(o) mp_obj_get_pin_obj(o)
#define mp_hal_pin_config_od(p) do { \
ETS_GPIO_INTR_DISABLE(); \
...
...
extmod/machine_i2c.c
View file @
624738ca
...
...
@@ -37,8 +37,8 @@
typedef
struct
_machine_i2c_obj_t
{
mp_obj_base_t
base
;
uint32_t
us_delay
;
mp_hal_pin_obj_t
*
scl
;
mp_hal_pin_obj_t
*
sda
;
mp_hal_pin_obj_t
scl
;
mp_hal_pin_obj_t
sda
;
}
machine_i2c_obj_t
;
STATIC
void
mp_hal_i2c_delay
(
machine_i2c_obj_t
*
self
)
{
...
...
stmhal/mphalport.h
View file @
624738ca
...
...
@@ -43,7 +43,7 @@ void mp_hal_set_interrupt_char(int c); // -1 to disable
// C-level pin HAL
#include "stmhal/pin.h"
#define mp_hal_pin_obj_t pin_obj_t
#define mp_hal_pin_obj_t pin_obj_t
*
#define mp_hal_get_pin_obj(o) (pin_obj_t*)pin_find(o)
#define mp_hal_pin_config_od(p) mp_hal_gpio_config((p)->gpio, (p)->pin, 5, 0, 0)
#define mp_hal_pin_low(p) GPIO_clear_pin((p)->gpio, (p)->pin_mask)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment