|
|
@@ -173,7 +173,8 @@ static int l_pwm_start(lua_State *L) {
|
|
|
if (channel < 0) {
|
|
|
return 0;
|
|
|
}
|
|
|
- int ret = luat_pwm_setup(confs[channel]);
|
|
|
+ luat_pwm_conf_t conf = *confs[channel];
|
|
|
+ int ret = luat_pwm_setup(&conf);
|
|
|
lua_pushboolean(L, ret == 0 ? 1 : 0);
|
|
|
return 1;
|
|
|
}
|
|
|
@@ -215,7 +216,8 @@ static int l_pwm_set_duty(lua_State *L) {
|
|
|
return 0;
|
|
|
}
|
|
|
confs[channel]->pulse = luaL_checkinteger(L, 2);
|
|
|
- int ret = luat_pwm_setup(confs[channel]);
|
|
|
+ luat_pwm_conf_t conf = *confs[channel];
|
|
|
+ int ret = luat_pwm_setup(&conf);
|
|
|
lua_pushboolean(L, ret == 0 ? 1 : 0);
|
|
|
return 1;
|
|
|
}
|
|
|
@@ -236,7 +238,8 @@ static int l_pwm_set_freq(lua_State *L) {
|
|
|
return 0;
|
|
|
}
|
|
|
confs[channel]->period = luaL_checkinteger(L, 2);
|
|
|
- int ret = luat_pwm_setup(confs[channel]);
|
|
|
+ luat_pwm_conf_t conf = *confs[channel];
|
|
|
+ int ret = luat_pwm_setup(&conf);
|
|
|
lua_pushboolean(L, ret == 0 ? 1 : 0);
|
|
|
return 1;
|
|
|
}
|