Skip to content

Commit

Permalink
bme280_math Lua 5.3 compatibility issue with lua_pushfstring
Browse files Browse the repository at this point in the history
  • Loading branch information
vsky committed Jul 12, 2020
1 parent f4bfe82 commit eafb83d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/modules/bme280_math.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,16 @@ int bme280_lua_setup(lua_State* L) {
#undef r16sLE_buf

int i = 1;
char cfg[2]={'\0', '\0'};
lua_createtable(L, 3, 0); /* configuration table */
lua_pushfstring(L, "%c", config);
cfg[0]=(char)config;
lua_pushstring(L, cfg);
lua_rawseti(L, -2, i++);
lua_pushfstring(L, "%c", bme280_ossh);
cfg[0]=(char)bme280_ossh;
lua_pushstring(L, cfg);
lua_rawseti(L, -2, i++);
lua_pushfstring(L, "%c", bme280_mode);
cfg[0]=(char)bme280_mode;
lua_pushstring(L, cfg);
lua_rawseti(L, -2, i);
return 2;
}
Expand Down

0 comments on commit eafb83d

Please sign in to comment.