diff --git a/einkfb.c b/einkfb.c index cb047caaf..778a7bc9e 100644 --- a/einkfb.c +++ b/einkfb.c @@ -169,7 +169,7 @@ static int blitToFrameBuffer(lua_State *L) { uint8_t *fbptr = (uint8_t*)(fb->data + ydest * fb->finfo.line_length + xdest / 2); - uint8_t *bbptr = (uint32_t*)(bb->data + + uint8_t *bbptr = (uint8_t*)(bb->data + yoffs * bb->w / 2 + xoffs / 2 ); diff --git a/tilecache.lua b/tilecache.lua index 8aa7657a3..ec3dbd913 100755 --- a/tilecache.lua +++ b/tilecache.lua @@ -11,12 +11,12 @@ function cacheclaim(size) return false end repeat - for k, v in pairs(cache) do - if v.age > 0 then + for k, _ in pairs(cache) do + if cache[k].age > 0 then print("aging slot="..k) - v.age = v.age - 1 + cache[k].age = cache[k].age - 1 else - cache_current_memsize = cache_current_memsize - v.size + cache_current_memsize = cache_current_memsize - cache[k].size cache[k] = nil break -- out of for loop end