Skip to content

Commit bbffff9

Browse files
committed
v2.1.3 (#6) final commit.
1 parent cfa7c7d commit bbffff9

4 files changed

Lines changed: 114 additions & 54 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# MiniOS v2.1.3 | Architectural update & RP2350 support
2+
3+
## Overview
4+
5+
This update is mainly focused on RP2350 microcontroller support. I also added a new experimental GUI-style settings menu. It is mostly vibe-coded for now so it does not work very well yet, but I will improve it ASAP.
6+
7+
I also added experimental wallpapers. I really liked the style, so in future updates I will probably make more wallpapers for each theme.
8+
9+
## New Features
10+
11+
- RP2350 support and new architectural changes to better separate devices from each other
12+
13+
> Pin config for RP2350 Pi Zero Waveshare
14+
15+
```c id="89x2ls"
16+
#define TFT_CS 17
17+
#define TFT_RST 20
18+
#define TFT_DC 26
19+
#define TFT_MOSI 19
20+
#define TFT_SCLK 18
21+
```
22+
23+
- New experimental settings menu
24+
- Experimental wallpaper support
25+
26+
## Improvements
27+
28+
- **Improved `name` command** - now it works more like an actual app setup flow in the terminal and asks the user for a username
29+
- **Display buffering improvements & terminal bugs addressed** - I made a small mistake in the `renderScreen()` function that caused the last line to sometimes not render properly
30+
31+
---
32+
33+
**Repository link:**
34+
[https://github.com/VuqarAhadli](https://github.com/VuqarAhadli)
35+
36+
**Version:** 2.1.3
37+
Author: Vugar Ahadli

include/coresys/config.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#define DEVICE_NAME "ESP32-S3"
2525

2626
#elif defined(DEVICE_RP2350)
27-
#define TFT_CS 17
28-
#define TFT_RST 20
29-
#define TFT_DC 26
27+
#define TFT_CS 17
28+
#define TFT_RST 20
29+
#define TFT_DC 26
3030
#define TFT_MOSI 19
3131
#define TFT_SCLK 18
3232

@@ -44,8 +44,8 @@
4444

4545
// TIME
4646
extern const char* NTP_SERVER;
47-
extern const long GMT_OFFSET;
48-
extern const int DAYLIGHT_OFFSET;
47+
extern const long GMT_OFFSET;
48+
extern const int DAYLIGHT_OFFSET;
4949

5050
// OS INFO
5151
extern const char* OS_VERSION;

src/drivers/display.cpp

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,48 @@ int bufferCount = 0;
3333
int scrollOffset = 0;
3434
std::string lineBuffer[SCROLL_BUFFER_SIZE];
3535

36+
void drawWallpaper() {
37+
tft.fillRect(0, 0, 80, 80, 0xE987);
38+
// rect 1 copy 1
39+
tft.fillRect(0, 80, 80, 80, 0x61B0);
40+
// rect 1 copy 2
41+
tft.fillRect(0, 160, 80, 80, 0x2E0F);
42+
// rect 1 copy 3
43+
tft.fillRect(80, 0, 80, 80, 0xE521);
44+
// rect 1 copy 4
45+
tft.fillRect(80, 80, 80, 80, 0x1AF6);
46+
// rect 1 copy 5
47+
tft.fillRect(80, 160, 80, 80, 0x63F1);
48+
// rect 1 copy 6
49+
tft.fillRect(160, 0, 80, 80, 0xFAA4);
50+
// rect 1 copy 7
51+
tft.fillRect(160, 80, 80, 80, 0xCEE7);
52+
// rect 1 copy 8
53+
tft.fillRect(160, 160, 80, 80, 0x651D);
54+
// rect 1 copy 9
55+
tft.fillRect(240, 0, 80, 80, 0x6225);
56+
// rect 1 copy 10
57+
tft.fillRect(240, 80, 80, 80, 0x1B9B);
58+
// rect 1 copy 11
59+
tft.fillRect(240, 160, 80, 80, 0xC0E5);
60+
}
61+
3662
void renderScreen(){
3763
if (bufferMutex != NULL) {
3864
xSemaphoreTake(bufferMutex, portMAX_DELAY);
3965
}
4066

4167
Theme current = getCurrentTheme();
42-
tft.fillScreen(current.bg);
68+
// tft.fillScreen(current.bg);
69+
drawWallpaper();
4370
tft.setTextColor(current.fg, current.bg);
4471

4572
int total = bufferCount;
4673
int start = total - LINES_ON_SCREEN - scrollOffset;
4774
if (start < 0) start = 0;
4875

4976
int y = 0;
50-
for(int i = start; i < total && i < start + LINES_ON_SCREEN; i++){
77+
for(int i = start; i < total && i < start + LINES_ON_SCREEN + 1; i++){
5178
int idx = (bufferHead - total + i + SCROLL_BUFFER_SIZE) % SCROLL_BUFFER_SIZE;
5279
tft.setCursor(5, y * LINE_HEIGHT);
5380
tft.println(lineBuffer[idx].c_str());
@@ -194,7 +221,8 @@ void initDisplay() {
194221

195222
void applyTheme() {
196223
Theme current = getCurrentTheme();
197-
tft.fillScreen(current.bg);
224+
// tft.fillScreen(current.bg);
225+
drawWallpaper();
198226
tft.setTextColor(current.fg);
199227
tft.setCursor(5, 0);
200228
currentCursorY = 0;
@@ -206,7 +234,8 @@ void clearScreen() {
206234
}
207235

208236
Theme current = getCurrentTheme();
209-
tft.fillScreen(current.bg);
237+
// tft.fillScreen(current.bg);
238+
drawWallpaper();
210239
tft.setCursor(5, 0);
211240
currentCursorY = 0;
212241
scrollOffset = 0;
@@ -221,7 +250,8 @@ void clearScreen() {
221250

222251
void newPage() {
223252
Theme current = getCurrentTheme();
224-
tft.fillScreen(current.bg);
253+
// tft.fillScreen(current.bg);
254+
drawWallpaper();
225255
tft.setCursor(5, 0);
226256
currentCursorY = 0;
227257
tft.setTextColor(current.fg, current.bg);

src/kernel/main.cpp

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -144,51 +144,49 @@ void serialInputProcess(void *parameter) {
144144
xSemaphoreGive(bufferMutex);
145145
}
146146

147-
if(currentScroll == 0){
148-
char c = Serial.read();
147+
char c = Serial.read();
148+
149+
150+
if (c == '\n') {
151+
if (currentScroll > 0) {
152+
scrollToBottom();
153+
continue;
154+
}
149155

150-
if (c == '\n') {
156+
tft.setTextColor(getCurrentTheme().fg, getCurrentTheme().bg);
157+
tft.print(" ");
158+
tft.setCursor(currentCursorX, currentCursorY);
151159

152-
tft.setTextColor(getCurrentTheme().fg, getCurrentTheme().bg);
160+
if (screenCleared) {
161+
currentCursorY = tft.getCursorY();
162+
screenCleared = false;
163+
tft.setCursor(5, currentCursorY);
164+
printPrompt(true);
165+
promptPrinted = true;
166+
}
167+
if (input.length() > 0) {
168+
addToBuffer(">" + getDeviceName() + "@Mini:" + input);
169+
printLineNoBuffer("");
170+
runCommand(input);
171+
currentCursorY = tft.getCursorY();
172+
tft.setCursor(5, currentCursorY);
173+
printPrompt(true);
174+
promptPrinted = true;
175+
tft.setTextColor(getCurrentTheme().bg, getCurrentTheme().fg);
153176
tft.print(" ");
154177
tft.setCursor(currentCursorX, currentCursorY);
178+
tft.setTextColor(getCurrentTheme().fg, getCurrentTheme().bg);
179+
}
155180

156-
if (screenCleared) {
157-
// if (input.length() > 0) {
158-
// print(input);
159-
// }
160-
// printLine("");
161-
currentCursorY = tft.getCursorY();
162-
screenCleared = false;
163-
tft.setCursor(5, currentCursorY);
164-
printPrompt(true);
165-
promptPrinted = true;
166-
167-
168-
}
169-
if (input.length() > 0) {
170-
171-
addToBuffer(">" + getDeviceName() + "@Mini:" + input);
172-
printLineNoBuffer("");
173-
runCommand(input);
174-
currentCursorY = tft.getCursorY();
175-
tft.setCursor(5, currentCursorY);
176-
printPrompt(true);
177-
promptPrinted = true;
178-
tft.setTextColor(getCurrentTheme().bg, getCurrentTheme().fg);
179-
tft.print(" ");
180-
tft.setCursor(currentCursorX, currentCursorY);
181-
tft.setTextColor(getCurrentTheme().fg, getCurrentTheme().bg);
182-
183-
}
184-
185-
input = "";
186-
overFlownLines = 0;
187-
initY = currentCursorY;
188-
promptPrinted = false;
189-
} else if (c == '\b' || c == 127) {
181+
input = "";
182+
overFlownLines = 0;
183+
initY = currentCursorY;
184+
promptPrinted = false;
185+
}
186+
// Other input only processed when at bottom
187+
else if (currentScroll == 0) {
188+
if (c == '\b' || c == 127) {
190189
if (input.length() > 0) {
191-
192190
input.pop_back();
193191
Serial.write('\b');
194192
Serial.write(' ');
@@ -197,12 +195,9 @@ void serialInputProcess(void *parameter) {
197195
CursorPosition previousChar = inputPositions.back();
198196
inputPositions.pop_back();
199197

200-
201198
currentCursorX = previousChar.x;
202199
currentCursorY = previousChar.y;
203200

204-
205-
206201
tft.setCursor(currentCursorX, currentCursorY);
207202
tft.print(" ");
208203
tft.setTextColor(getCurrentTheme().bg, getCurrentTheme().fg);
@@ -211,7 +206,6 @@ void serialInputProcess(void *parameter) {
211206
tft.setTextColor(getCurrentTheme().fg, getCurrentTheme().bg);
212207
tft.setCursor(currentCursorX, currentCursorY);
213208
}
214-
215209
} else {
216210
input += c;
217211
inputPositions.push_back({currentCursorX, currentCursorY});
@@ -227,7 +221,6 @@ void serialInputProcess(void *parameter) {
227221
tft.print(" ");
228222
tft.setCursor(currentCursorX, currentCursorY);
229223
tft.setTextColor(getCurrentTheme().fg, getCurrentTheme().bg);
230-
231224
}
232225
}
233226

0 commit comments

Comments
 (0)