|
@@ -243,7 +243,7 @@ static int l_gpio_setup(lua_State *L) {
|
|
|
luat_gpio_t conf = {0};
|
|
luat_gpio_t conf = {0};
|
|
|
conf.pin = luaL_checkinteger(L, 1);
|
|
conf.pin = luaL_checkinteger(L, 1);
|
|
|
if (conf.pin >= LUAT_GPIO_PIN_MAX) {
|
|
if (conf.pin >= LUAT_GPIO_PIN_MAX) {
|
|
|
- LLOGW("id shall < %d but %d", LUAT_GPIO_PIN_MAX, conf.pin);
|
|
|
|
|
|
|
+ LLOGW("id out of range 0 ~ %d, but %d", LUAT_GPIO_PIN_MAX, conf.pin);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
//conf->mode = luaL_checkinteger(L, 2);
|
|
//conf->mode = luaL_checkinteger(L, 2);
|
|
@@ -687,7 +687,7 @@ log.info("irq cnt", gpio.count(10))
|
|
|
static int l_gpio_get_count(lua_State *L) {
|
|
static int l_gpio_get_count(lua_State *L) {
|
|
|
uint8_t pin = luaL_checkinteger(L, 1);
|
|
uint8_t pin = luaL_checkinteger(L, 1);
|
|
|
if (pin >= LUAT_GPIO_PIN_MAX) {
|
|
if (pin >= LUAT_GPIO_PIN_MAX) {
|
|
|
- LLOGW("id shall < %d but %d", LUAT_GPIO_PIN_MAX, pin);
|
|
|
|
|
|
|
+ LLOGW("id out of range 0 ~ %d, but %d", LUAT_GPIO_PIN_MAX, pin);
|
|
|
lua_pushinteger(L, 0);
|
|
lua_pushinteger(L, 0);
|
|
|
return 1;
|
|
return 1;
|
|
|
}
|
|
}
|