Skip to content

Commit

Permalink
fix: rbprotocol, position precision
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasssadar committed Jul 9, 2024
1 parent f0c4ad2 commit 79e5a4a
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ dependencies:
idf: ">=5.1"
RB3201-RBProtocol-library:
git: https://github.com/RoboticsBrno/RB3201-RBProtocol-library.git
version: v14.0.1
version: v14.0.2
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"maintainer": true
}
],
"version": "5.3.1",
"version": "5.3.2",
"frameworks": ["espidf", "arduino"],
"platforms": "espressif32",
"dependencies": [
{
"name": "RB3201-RBProtocol",
"version": "https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.1.zip"
"version": "https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.2.zip"
}
],
"build": {
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ framework = arduino
upload_speed = 921600
monitor_speed = 115200

lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.1.zip
lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.2.zip
2 changes: 1 addition & 1 deletion src/gridui_version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#pragma once

#define RB_GRIDUI_VERSION 0x050301
#define RB_GRIDUI_VERSION 0x050302
5 changes: 4 additions & 1 deletion src/widgets/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ WidgetState::WidgetState(uint16_t uuid, float x, float y, float w, float h, uint
, m_bloom_global(0)
, m_bloom_tick(0) {

m_data.set("p", WidgetPos(x, y, w, h).encoded());
char buf[9];
snprintf(buf, sizeof(buf), "%lx", WidgetPos(x, y, w, h).encoded());
m_data.set("p", new rbjson::String(buf));

if(tab != 0) {
m_data.set("tab", tab);
}
Expand Down
2 changes: 1 addition & 1 deletion test-inis/esp32-idf3-arduino.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ build_flags =
-fmax-errors=5
-DLX16A_ARDUINO=1

lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.1.zip
lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.2.zip
2 changes: 1 addition & 1 deletion test-inis/esp32-idf4-arduino.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ build_flags =
-fmax-errors=5
-DLX16A_ARDUINO=1

lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.1.zip
lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.2.zip
2 changes: 1 addition & 1 deletion test-inis/esp32-idf5-idf.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ build_flags =
-std=gnu++14
-fmax-errors=5

lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.1.zip
lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.2.zip
2 changes: 1 addition & 1 deletion test-inis/esp32c3-idf4-arduino.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ build_flags =
-fmax-errors=5
-DLX16A_ARDUINO=1

lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.1.zip
lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.2.zip
2 changes: 1 addition & 1 deletion test-inis/esp32c3-idf5-idf.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ build_flags =
-std=gnu++14
-fmax-errors=5

lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.1.zip
lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.2.zip
2 changes: 1 addition & 1 deletion test-inis/esp32s3-idf4-arduino.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ build_flags =
-fmax-errors=5
-DLX16A_ARDUINO=1

lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.1.zip
lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.2.zip
2 changes: 1 addition & 1 deletion test-inis/esp32s3-idf5-idf.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ build_flags =
-std=gnu++14
-fmax-errors=5

lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.1.zip
lib_deps = https://github.com/RoboticsBrno/RB3201-RBProtocol-library/archive/refs/tags/v14.0.2.zip
4 changes: 4 additions & 0 deletions web/js/05_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ Widget.prototype.applyState = function (state) {
var v = state[k]

if(k === "p") {
if(typeof v === "string") {
v = parseInt(v, 16);
}

this.x = (v & 0xFF)/10;
this.y = ((v >> 8) & 0xFF)/10;
this.w = ((v >> 16) & 0xFF)/10;
Expand Down

0 comments on commit 79e5a4a

Please sign in to comment.