diff --git a/.gitignore b/.gitignore index 5e23e4d..cf503c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target push.sh u2c.py +version diff --git a/lua/src/dcode.lua b/lua/src/dcode.lua index 6e19a09..359cfa5 100644 --- a/lua/src/dcode.lua +++ b/lua/src/dcode.lua @@ -1,7 +1,7 @@ local char, byte, floor, band, rshift = string.char, string.byte, math.floor, bit32.band, bit32.arshift -local PREC = 8 +local PREC = 10 local PREC_POW = 2 ^ PREC local PREC_POW_HALF = 2 ^ (PREC - 1) local STRENGTH_MIN = 2 ^ (PREC - 8 + 1) diff --git a/lua/src/main.lua b/lua/src/main.lua index eb13846..9d49d9f 100644 --- a/lua/src/main.lua +++ b/lua/src/main.lua @@ -50,7 +50,7 @@ function ui() end local dcode = require "dcode" -local make_decoder = dcode.make_dec +local make_decoder = dcode.make_truebit_dec local ws = http.websocket("ws://vps.sad.ovh:5821/ws") diff --git a/rust/src/main.rs b/rust/src/main.rs index e6742a9..a889ac0 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -506,7 +506,7 @@ struct DfpwmEncoder { } impl DfpwmEncoder { - const CONST_PREC: i32 = 10; + const CONST_PREC: i32 = 8; fn new() -> Self { Self { q: 0, s: 0, lt: -128 }