Public Access
M1 step 4b: IRC Service on the device; 8-bit frame buffer
- IrcService: networking on its own task, TLS with the built-in CA bundle (or trust-on-first-use pinning when self-signed is allowed), plain TCP when TLS is off; connects only while Wi-Fi is Connected, marks pauses for Monitoring, reconnects with backoff, pings a quiet server, writes Logs, raises Notifications for Mentions - Session: forget /quit once disconnected (it was handled every loop); the server Buffer never counts as unread (MOTD showed as [4]) - Status Bar: unread count - Frame buffer 16 -> 8-bit colour (M1 Q46): min free heap with IRC on TLS went from 51 KB to 79 KB - Serial: irc start / say / dump Verified on the device against irc.libera.chat:6697: certificate checked, joined #roro9stack-test, sent a message, quit cleanly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
namespace roro {
|
||||
|
||||
bool Screen::begin() {
|
||||
canvas_.setColorDepth(16);
|
||||
canvas_.setColorDepth(8); // RGB332: saves 32 KB of RAM (M1 Q46); theme colours are converted
|
||||
canvas_.setPsram(false);
|
||||
return canvas_.createSprite(theme::kWidth, theme::kHeight) != nullptr;
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ namespace roro {
|
||||
// Composes the frame (Status Bar, foreground App, Toast) off-screen and pushes it to the display.
|
||||
class Screen {
|
||||
public:
|
||||
bool begin(); // allocates the frame buffer (~64 KB)
|
||||
bool begin(); // allocates the frame buffer (~32 KB at 8-bit colour)
|
||||
void render(AppManager& apps, const StatusInfo& status, const Toast* toast);
|
||||
Canvas& canvas() { return canvas_; }
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ void statusBar(Canvas& c, const StatusInfo& info) {
|
||||
x -= c.textWidth(text.c_str()) + 6;
|
||||
};
|
||||
right(info.clock, kText);
|
||||
if (info.unread > 0) right("[" + std::to_string(info.unread) + "]", kMessage);
|
||||
if (info.batteryPercent >= 0)
|
||||
right(std::to_string(info.batteryPercent) + "%", info.batteryPercent <= 15 ? kWarning : kText);
|
||||
if (info.sdPresent) right("SD", info.sdLevel >= 80 ? kWarning : kMuted);
|
||||
|
||||
+2
-1
@@ -23,11 +23,12 @@ struct StatusInfo {
|
||||
char compose = 0; // pending Compose Key state
|
||||
enum class Wifi { None, Searching, Connected, Monitoring } wifi = Wifi::None;
|
||||
int wifiBars = 0; // 0..3 when Connected
|
||||
int unread = 0; // unread messages across Services
|
||||
|
||||
bool operator==(const StatusInfo& o) const {
|
||||
return title == o.title && batteryPercent == o.batteryPercent && clock == o.clock &&
|
||||
sdPresent == o.sdPresent && sdLevel == o.sdLevel && compose == o.compose && wifi == o.wifi &&
|
||||
wifiBars == o.wifiBars;
|
||||
wifiBars == o.wifiBars && unread == o.unread;
|
||||
}
|
||||
bool operator!=(const StatusInfo& o) const { return !(*this == o); }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user