Skip to content

Commit 8c1501e

Browse files
committed
freq setup 240 & packet filter in radio begin
1 parent 2d8ac6d commit 8c1501e

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

tinyGS/src/Radio/Radio.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int16_t Radio::begin()
9292
status.radio_ready = false;
9393
board_type board = ConfigManager::getInstance().getBoardConfig();
9494
const char* modemConfig = ConfigManager::getInstance().getModemStartup();
95-
size_t size = JSON_ARRAY_SIZE(10) + 10*JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(15) + JSON_ARRAY_SIZE(8) + 60;
95+
size_t size = JSON_ARRAY_SIZE(10) + 10*JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(16) + JSON_ARRAY_SIZE(8) + JSON_ARRAY_SIZE(8) +64;
9696
DynamicJsonDocument doc(size);
9797
DeserializationError error = deserializeJson(doc, modemConfig);
9898

@@ -193,6 +193,17 @@ int16_t Radio::begin()
193193
}
194194

195195

196+
// packets Filter
197+
uint8_t filterSize = doc["filter"].size();
198+
for (int i=0; i<8; i++)
199+
{
200+
if (i < filterSize)
201+
status.modeminfo.filter[i] = doc["filter"][i];
202+
else
203+
status.modeminfo.filter[i] = 0;
204+
}
205+
206+
196207
if (state == ERR_NONE)
197208
{
198209
Log::console(PSTR("success!"));

tinyGS/src/Status.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct TextFrame {
6262
};
6363

6464
struct Status {
65-
const uint32_t version = 2104160; // version year month day release
65+
const uint32_t version = 2104181; // version year month day release
6666
const char* git_version = GIT_VERSION;
6767
bool mqtt_connected = false;
6868
bool radio_ready = false;

tinyGS/tinyGS.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ void wifiConnected()
145145
}
146146

147147
void setup()
148-
{
148+
{
149+
setCpuFrequencyMhz(240);
149150
Serial.begin(115200);
150151
delay(100);
151152

@@ -208,7 +209,7 @@ void loop() {
208209

209210
mqtt.loop();
210211
OTA::loop();
211-
displayUpdate();
212+
if (configManager.getOledBright() != 0) displayUpdate();
212213
}
213214

214215
void setupNTP()

0 commit comments

Comments
 (0)