Add a stub mgos_gpio_remove_int_handler()
This commit is contained in:
@ -133,3 +133,12 @@ bool mgos_gpio_set_pull(int pin, enum mgos_gpio_pull_type pull) {
|
|||||||
(void)pin;
|
(void)pin;
|
||||||
(void)pull;
|
(void)pull;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mgos_gpio_remove_int_handler(int pin, mgos_gpio_int_handler_f *old_cb, void **old_arg) {
|
||||||
|
LOG(LL_INFO, ("Not implemented."));
|
||||||
|
return;
|
||||||
|
|
||||||
|
(void)pin;
|
||||||
|
(void)old_cb;
|
||||||
|
(void)old_arg;
|
||||||
|
}
|
||||||
|
36
tests/mcp23xxx.c
Normal file
36
tests/mcp23xxx.c
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#include "mgos.h"
|
||||||
|
#include "mgos_mcp23xxx.h"
|
||||||
|
#include "tests_autogen.h"
|
||||||
|
|
||||||
|
uint32_t test_mcp23xxx_period_ms = 100;
|
||||||
|
bool test_mcp23xxx_enabled = true;
|
||||||
|
|
||||||
|
static struct mgos_mcp23xxx *s_dev;
|
||||||
|
|
||||||
|
bool test_mcp23xxx_create(void) {
|
||||||
|
uint8_t i;
|
||||||
|
s_dev = mgos_mcp23017_create(mgos_i2c_get_global(), 0x20, -1);
|
||||||
|
if (!s_dev) return NULL;
|
||||||
|
|
||||||
|
for (i=0; i<8; i++)
|
||||||
|
mgos_mcp23xxx_gpio_setup_input(s_dev, i, MGOS_GPIO_PULL_UP);
|
||||||
|
|
||||||
|
for (i=8; i<16; i++)
|
||||||
|
mgos_mcp23xxx_gpio_set_mode(s_dev, i, MGOS_GPIO_MODE_OUTPUT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool test_mcp23xxx_run(void) {
|
||||||
|
uint8_t i;
|
||||||
|
mgos_mcp23xxx_gpio_read(s_dev, 0);
|
||||||
|
|
||||||
|
for (i=8; i<16; i++)
|
||||||
|
mgos_mcp23xxx_gpio_write(s_dev, i, random()%2);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool test_mcp23xxx_destroy(void) {
|
||||||
|
mgos_mcp23xxx_destroy(&s_dev);
|
||||||
|
return true;
|
||||||
|
}
|
Reference in New Issue
Block a user