Skip to content

Commit

Permalink
Fix typewriter USB HCI example
Browse files Browse the repository at this point in the history
  • Loading branch information
martinberlin committed Nov 10, 2024
1 parent aace315 commit 4e3a779
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 8 additions & 3 deletions examples/v7-usb-device/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@

# Select only ONE app_source:

# Dumb slow terminal example, type and write character in display
#set(app_sources "serial-note.c")


# Still in research "serial-receive-file.c" IDEA: To make a port of rz (zmodem serial receive protocol to transfer image via serial)

set(app_sources "msc-sd/msc_main.cpp")
set(app_sources
# Dumb slow terminal example, type and write character in display

"serial-note.c"
#"msc-sd/msc_main.cpp"
#"msc-sd/msc_only_sd.cpp"
)

set(requires epdiy esp_tinyusb fatfs console
# JpegDecoder
Expand Down
6 changes: 4 additions & 2 deletions examples/v7-usb-device/main/serial-note.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ void tinyusb_cdc_rx_callback(int itf, cdcacm_event_t *event)
temperature = epd_ambient_temperature();
char strbuf[520];
sprintf(strbuf, "%s", buf);
cursor_x+=10;
epd_write_string(&FiraSans_20, strbuf, &cursor_x, &cursor_y, fb, &font_props);
// 0D: Carriage return
if (buf[0] == 0x0D) {
cursor_y += 16;
cursor_y += 18;
cursor_x = 10;
} else {
cursor_y = temp_y;
Expand Down Expand Up @@ -131,7 +132,8 @@ const char *descriptor_str[] = {

void app_main(void)
{
printf("Serial example\n");
printf("Serial example starting in 2 seconds\n");
vTaskDelay(pdMS_TO_TICKS(2000));
// EPDiy init
epd_init(&epd_board_v7, &ED097TC2, EPD_LUT_64K);
epd_set_vcom(1760);
Expand Down

0 comments on commit 4e3a779

Please sign in to comment.