Skip to content

Commit a86ead8

Browse files
committed
Test on 128x32, new PBs to match 8e89fdf
1 parent 8529924 commit a86ead8

File tree

19 files changed

+42
-37
lines changed

19 files changed

+42
-37
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_Out_Ssd1306.h

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ class WipperSnapper_I2C_Driver_Out_Ssd1306
6363
@returns True if initialized successfully, False otherwise.
6464
*/
6565
bool begin() {
66+
WS_DEBUG_PRINT("New SSD1306 with height: ");
67+
WS_DEBUG_PRINT(_height);
68+
WS_DEBUG_PRINT(" width: ");
69+
WS_DEBUG_PRINT(_width);
70+
WS_DEBUG_PRINT(" text size: ");
71+
WS_DEBUG_PRINT(_text_sz);
6672
_display = new Adafruit_SSD1306(_width, _height, _i2c);
67-
bool did_begin = _display->begin(
68-
SSD1306_SWITCHCAPVCC,
69-
0x3C); // TODO: Note that this is hardcoded, not sure why not init'd yet
73+
// TODO: Use _sensorAddress instead of 0x3C hardcode!
74+
bool did_begin = _display->begin(SSD1306_SWITCHCAPVCC, 0x3C);
7075
if (!did_begin)
71-
return false;
72-
73-
// Show initial display buffer contents on the screen --
74-
// the library initializes this with an Adafruit splash screen.
75-
_display->display();
76-
delay(1000);
76+
return false;
7777
// Clear the buffer
7878
_display->clearDisplay();
7979
// Configure the text size and color
@@ -82,7 +82,7 @@ class WipperSnapper_I2C_Driver_Out_Ssd1306
8282
// Reset the cursor position
8383
_display->setCursor(0, 0);
8484
_display->display();
85-
return true;
85+
return did_begin;
8686
}
8787

8888
/*!
@@ -118,21 +118,27 @@ class WipperSnapper_I2C_Driver_Out_Ssd1306
118118
WS_DEBUG_PRINTLN(line_height);
119119

120120
int16_t y_idx = 0;
121+
uint16_t c_idx = 0;
121122
_display->setCursor(0, y_idx);
122-
for (int i = 0; message[i] != '\0'; i++) {
123-
if (message[i] == '\n') {
123+
for (int i = 0; i < strlen(message); i++) {
124+
char c = message[c_idx];
125+
if (c == '\\' && message[c_idx + 1] == 'n') {
124126
WS_DEBUG_PRINTLN("New line detected!");
127+
// Skip the '\n' character in the buffer
128+
c_idx += 2;
129+
// Move the cursor to the next line
125130
y_idx += line_height;
126131
_display->setCursor(0, y_idx);
127132
} else {
128133
WS_DEBUG_PRINT("Printing char: ");
129-
WS_DEBUG_PRINT(message[i]);
134+
WS_DEBUG_PRINT(message[c_idx]);
130135
WS_DEBUG_PRINT(" at y: ");
131136
WS_DEBUG_PRINTLN(y_idx);
132-
_display->print(message[i]);
137+
_display->print(message[c_idx]);
138+
_display->display();
139+
c_idx++;
133140
}
134141
}
135-
_display->display();
136142
}
137143

138144
protected:

src/wippersnapper/description/v1/description.pb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.4.5-dev at Mon May 19 19:15:20 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Tue May 20 15:26:04 2025. */
33

44
#include "wippersnapper/description/v1/description.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40

src/wippersnapper/description/v1/description.pb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb header */
2-
/* Generated by nanopb-0.4.5-dev at Mon May 19 19:15:20 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Tue May 20 15:26:04 2025. */
33

44
#ifndef PB_WIPPERSNAPPER_DESCRIPTION_V1_WIPPERSNAPPER_DESCRIPTION_V1_DESCRIPTION_PB_H_INCLUDED
55
#define PB_WIPPERSNAPPER_DESCRIPTION_V1_WIPPERSNAPPER_DESCRIPTION_V1_DESCRIPTION_PB_H_INCLUDED

src/wippersnapper/ds18x20/v1/ds18x20.pb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.4.5-dev at Mon May 19 19:15:20 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Tue May 20 15:26:04 2025. */
33

44
#include "wippersnapper/ds18x20/v1/ds18x20.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40

src/wippersnapper/ds18x20/v1/ds18x20.pb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb header */
2-
/* Generated by nanopb-0.4.5-dev at Mon May 19 19:15:20 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Tue May 20 15:26:04 2025. */
33

44
#ifndef PB_WIPPERSNAPPER_DS18X20_V1_WIPPERSNAPPER_DS18X20_V1_DS18X20_PB_H_INCLUDED
55
#define PB_WIPPERSNAPPER_DS18X20_V1_WIPPERSNAPPER_DS18X20_V1_DS18X20_PB_H_INCLUDED

src/wippersnapper/i2c/v1/i2c.pb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.4.5-dev at Mon May 19 19:15:20 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Tue May 20 15:26:04 2025. */
33

44
#include "wippersnapper/i2c/v1/i2c.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40

src/wippersnapper/i2c/v1/i2c.pb.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb header */
2-
/* Generated by nanopb-0.4.5-dev at Mon May 19 19:15:20 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Tue May 20 15:26:04 2025. */
33

44
#ifndef PB_WIPPERSNAPPER_I2C_V1_WIPPERSNAPPER_I2C_V1_I2C_PB_H_INCLUDED
55
#define PB_WIPPERSNAPPER_I2C_V1_WIPPERSNAPPER_I2C_V1_I2C_PB_H_INCLUDED
@@ -69,8 +69,7 @@ typedef enum _wippersnapper_i2c_v1_LEDBackpackAlignment {
6969
typedef enum _wippersnapper_i2c_v1_SSD1306TextSize {
7070
wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_UNSPECIFIED = 0,
7171
wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_1 = 1,
72-
wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_2 = 2,
73-
wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_3 = 3
72+
wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_2 = 2
7473
} wippersnapper_i2c_v1_SSD1306TextSize;
7574

7675
/* Struct definitions */
@@ -227,8 +226,8 @@ typedef struct _wippersnapper_i2c_v1_I2CDeviceInitRequest {
227226
#define _wippersnapper_i2c_v1_LEDBackpackAlignment_ARRAYSIZE ((wippersnapper_i2c_v1_LEDBackpackAlignment)(wippersnapper_i2c_v1_LEDBackpackAlignment_LED_BACKPACK_ALIGNMENT_RIGHT+1))
228227

229228
#define _wippersnapper_i2c_v1_SSD1306TextSize_MIN wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_UNSPECIFIED
230-
#define _wippersnapper_i2c_v1_SSD1306TextSize_MAX wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_3
231-
#define _wippersnapper_i2c_v1_SSD1306TextSize_ARRAYSIZE ((wippersnapper_i2c_v1_SSD1306TextSize)(wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_3+1))
229+
#define _wippersnapper_i2c_v1_SSD1306TextSize_MAX wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_2
230+
#define _wippersnapper_i2c_v1_SSD1306TextSize_ARRAYSIZE ((wippersnapper_i2c_v1_SSD1306TextSize)(wippersnapper_i2c_v1_SSD1306TextSize_SSD1306_TEXT_SIZE_2+1))
232231

233232

234233
#ifdef __cplusplus

src/wippersnapper/pin/v1/pin.pb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.4.5-dev at Mon May 19 19:15:20 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Tue May 20 15:26:04 2025. */
33

44
#include "wippersnapper/pin/v1/pin.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40

src/wippersnapper/pin/v1/pin.pb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb header */
2-
/* Generated by nanopb-0.4.5-dev at Mon May 19 19:15:20 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Tue May 20 15:26:04 2025. */
33

44
#ifndef PB_WIPPERSNAPPER_PIN_V1_WIPPERSNAPPER_PIN_V1_PIN_PB_H_INCLUDED
55
#define PB_WIPPERSNAPPER_PIN_V1_WIPPERSNAPPER_PIN_V1_PIN_PB_H_INCLUDED

src/wippersnapper/pixels/v1/pixels.pb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.4.5-dev at Mon May 19 19:15:20 2025. */
2+
/* Generated by nanopb-0.4.5-dev at Tue May 20 15:26:04 2025. */
33

44
#include "wippersnapper/pixels/v1/pixels.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40

0 commit comments

Comments
 (0)