Some C and Make magic

This commit is contained in:
Steven Tracey 2024-11-20 08:34:30 -05:00
parent 9e4ada6897
commit 077b8298a4
3 changed files with 15 additions and 2 deletions

2
.gitignore vendored
View File

@ -117,3 +117,5 @@ c/build
!c/Makefile !c/Makefile
go/go_p2fa.h go/go_p2fa.h
c/libs/go_p2fa.h c/libs/go_p2fa.h
test.go

View File

@ -27,7 +27,7 @@ else ifeq ($(USELIB_RPI), USE_LGPIO_LIB)
else ifeq ($(USELIB_RPI), USE_DEV_LIB) else ifeq ($(USELIB_RPI), USE_DEV_LIB)
LIB_RPI += -lgpiod -lm LIB_RPI += -lgpiod -lm
endif endif
LIB_RPI += -L./libs -lgo_p2fa LIB_RPI += -L./libs -lgo_p2fa -Wl,-rpath,./libs
DEBUG_RPI = -D $(USELIB_RPI) -D RPI DEBUG_RPI = -D $(USELIB_RPI) -D RPI
USELIB_JETSONI = USE_DEV_LIB USELIB_JETSONI = USE_DEV_LIB

View File

@ -26,11 +26,22 @@ int draw() {
EPD_2in13_V4_Init(); EPD_2in13_V4_Init();
Paint_Clear(WHITE); Paint_Clear(WHITE);
Paint_DrawString(32, 10, "Hello, World!", &Font16, WHITE, BLACK);
const char *confName = "default"; const char *confName = "default";
GoString confStr = {confName, strlen(confName)}; GoString confStr = {confName, strlen(confName)};
const char *code = getCode(confStr); const char *code = getCode(confStr);
Paint_DrawString(5, 5, code, &Font24, WHITE, BLACK); Paint_DrawString(5, 5, code, &Font24, WHITE, BLACK);
Paint_DrawRectangle(10, 112, 240, 92, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
uint64_t *timeLeft = getTimeRemainingMS(30);
for (int j = 0; j < 3; ++j) {
for (int i = getTimeRemainingMS(30); i > 200; i = getTimeRemainingMS(30)) {
Paint_DrawRectangle(10, 112, (timeLeft/(30*1000)) * 240, 92, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
DEV_Delay_ms(100);
}
}
DEV_Delay_ms(5000); DEV_Delay_ms(5000);
Debug("Clear...\r\n"); Debug("Clear...\r\n");