Stop using liba and the filesystem

This commit is contained in:
Heath123
2022-11-17 12:10:43 +00:00
parent b463f0236b
commit 04e4220cfc
4 changed files with 21 additions and 16 deletions

View File

@@ -5,5 +5,5 @@ EPSILON_TELEMETRY ?= 0
HANDY_TARGETS_EXTENSIONS = bin
USE_LIBA = 1
# USE_LIBA = 1
POINCARE_TREE_LOG = 0

View File

@@ -43,5 +43,5 @@ ion_src := $(filter-out $(sdl_simu_needs_to_be_removed),$(ion_src))
SFLAGS := $(filter-out -Iion/src/simulator/external/sdl/include,$(SFLAGS))
SFLAGS += -fno-stack-protector
LDFLAGS += -nodefaultlibs
# SFLAGS += -fno-stack-protector
# LDFLAGS += -nodefaultlibs

View File

@@ -38,8 +38,8 @@ void draw() {
// printf("draw\n");
draw_count++;
if (draw_count == 60) {
printf("draw_count == 60\n");
if (draw_count == 10) {
printf("draw_count == 10\n");
const KDColor* pixels = Framebuffer::address();
// Loop over all the pixels excluding the status bar
@@ -52,8 +52,13 @@ void draw() {
}
}
printf("hash: %lu\n", hash);
if (hash == 4352844898) {
printf("SUCCESS\n");
} else {
printf("FAILURE\n");
}
Framebuffer::writeToFile("test.bin");
// Framebuffer::writeToFile("test.bin");
}
}

View File

@@ -48,16 +48,16 @@ void setActive(bool enabled) {
}
void writeToFile(const char * filename) {
// Write as a raw RGB565 file
FILE * f = fopen(filename, "wb");
if (f == NULL) {
return;
}
for (int i = 0; i < Ion::Display::Width * Ion::Display::Height; i++) {
uint16_t color = sPixels[i];
fwrite(&color, 2, 1, f);
}
fclose(f);
// // Write as a raw RGB565 file
// FILE * f = fopen(filename, "wb");
// if (f == NULL) {
// return;
// }
// for (int i = 0; i < Ion::Display::Width * Ion::Display::Height; i++) {
// uint16_t color = sPixels[i];
// fwrite(&color, 2, 1, f);
// }
// fclose(f);
}
}