Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,13 @@ void task_print(void *pvParameters)
String buffer = answer;
answer = "";
int count = 0;
const char *cstr = buffer.c_str();

for (int i = 0; i < len; i++)
{
// 1文字づつ表示
String str = buffer.substring(i, i + 1);
char ch = cstr[i];

Copy link

Copilot AI May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a comment to explain why spaces and question marks are skipped here, improving code readability for future maintainers.

Suggested change
// Skip spaces and question marks to avoid unnecessary sound effects or visual updates.

Copilot uses AI. Check for mistakes.
if (str == " " || str == "?")
{
}
else
if (ch != ' ' && ch != '?')
{
count++;
if (count % 2 == 1)
Expand All @@ -221,7 +218,7 @@ void task_print(void *pvParameters)

portENTER_CRITICAL_ISR(&display_mutex);
canvas.setTextColor(GREEN);
canvas.printf("%s", str.c_str());
canvas.write(ch);
canvas.pushSprite(4, 4);
portEXIT_CRITICAL_ISR(&display_mutex);
}
Expand Down