Skip to content

Commit f4df94a

Browse files
committed
Delete the sensor part and adapt to the latest crc display.
1 parent 6e6c59d commit f4df94a

File tree

4 files changed

+7
-44
lines changed

4 files changed

+7
-44
lines changed

src/helpers/ui/GxEPDDisplay.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ void GxEPDDisplay::fillRect(int x, int y, int w, int h) {
9494
display_crc.update<int>(y);
9595
display_crc.update<int>(w);
9696
display_crc.update<int>(h);
97-
display.fillRect(x*SCALE_X, y*SCALE_Y, w*SCALE_X, h*SCALE_Y, _curr_color);
97+
display.fillRect(x*scale_x, y*scale_y, w*scale_x, h*scale_y, _curr_color);
9898
}
9999

100100
void GxEPDDisplay::drawRect(int x, int y, int w, int h) {
101101
display_crc.update<int>(x);
102102
display_crc.update<int>(y);
103103
display_crc.update<int>(w);
104104
display_crc.update<int>(h);
105-
display.drawRect(x*SCALE_X, y*SCALE_Y, w*SCALE_X, h*SCALE_Y, _curr_color);
105+
display.drawRect(x*scale_x, y*scale_y, w*scale_x, h*scale_y, _curr_color);
106106
}
107107

108108
void GxEPDDisplay::drawXbm(int x, int y, const uint8_t* bits, int w, int h) {

variants/mesh_pocket/platformio.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ lib_deps =
3030
rweather/Crypto @ ^0.4.0
3131
stevemarple/MicroNMEA @ ^2.0.6
3232
zinggjm/GxEPD2 @ 1.6.2
33+
bakercp/CRC32 @ ^2.0.0
3334

3435
debug_tool = jlink
3536
upload_protocol = nrfutil
@@ -72,6 +73,7 @@ build_flags =
7273
-D MAX_GROUP_CHANNELS=8
7374
-D BLE_PIN_CODE=123456
7475
-D OFFLINE_QUEUE_SIZE=256
76+
-D AUTO_OFF_MILLIS=0
7577
; -D BLE_DEBUG_LOGGING=1
7678
; -D MESH_PACKET_LOGGING=1
7779
; -D MESH_DEBUG=1
@@ -91,6 +93,7 @@ build_flags =
9193
-I examples/companion_radio/ui-new
9294
-D MAX_CONTACTS=100
9395
-D MAX_GROUP_CHANNELS=8
96+
-D AUTO_OFF_MILLIS=0
9497
; -D BLE_PIN_CODE=123456
9598
; -D BLE_DEBUG_LOGGING=1
9699
; -D MESH_PACKET_LOGGING=1

variants/mesh_pocket/target.cpp

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BU
99

1010
WRAPPER_CLASS radio_driver(radio, board);
1111

12-
MeshPocketSensorManager sensors = MeshPocketSensorManager();
12+
SensorManager sensors = SensorManager();
1313

1414
VolatileRTCClock fallback_clock;
1515
AutoDiscoverRTCClock rtc_clock(fallback_clock);
@@ -42,31 +42,3 @@ mesh::LocalIdentity radio_new_identity() {
4242
RadioNoiseListener rng(radio);
4343
return mesh::LocalIdentity(&rng); // create new random identity
4444
}
45-
46-
bool MeshPocketSensorManager::begin() {
47-
return true;
48-
}
49-
50-
void MeshPocketSensorManager::loop() {
51-
52-
}
53-
54-
bool MeshPocketSensorManager::querySensors(uint8_t requester_permission, CayenneLPP& telemetry) {
55-
return true;
56-
}
57-
58-
int MeshPocketSensorManager::getNumSettings() const {
59-
return 0;
60-
}
61-
62-
const char* MeshPocketSensorManager::getSettingName(int i) const {
63-
return NULL;
64-
}
65-
66-
const char* MeshPocketSensorManager::getSettingValue(int i) const {
67-
return NULL;
68-
}
69-
70-
bool MeshPocketSensorManager::setSettingValue(const char* name, const char* value) {
71-
return false;
72-
}

variants/mesh_pocket/target.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,5 @@ void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
2929
void radio_set_tx_power(uint8_t dbm);
3030
mesh::LocalIdentity radio_new_identity();
3131

32-
class MeshPocketSensorManager : public SensorManager {
33-
public:
34-
MeshPocketSensorManager() {};
35-
bool begin() override;
36-
bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry);
37-
void loop();
38-
int getNumSettings() const override;
39-
const char* getSettingName(int i) const override;
40-
const char* getSettingValue(int i) const override;
41-
bool setSettingValue(const char* name, const char* value) override;
42-
};
43-
44-
extern MeshPocketSensorManager sensors;
32+
extern SensorManager sensors;
4533

0 commit comments

Comments
 (0)