diff --git a/boot/device/flash.ld b/boot/device/flash.ld index 2dff686ac..2a9f13627 100644 --- a/boot/device/flash.ld +++ b/boot/device/flash.ld @@ -21,7 +21,7 @@ MEMORY { */ } -FRAMEBUFFER_SIZE = 9600; +FRAMEBUFFER_SIZE = 19200; STACK_SIZE = 4K; SECTIONS { diff --git a/ion/platform/device/display.c b/ion/platform/device/display.c index 3aaa2242a..3f75b55a9 100644 --- a/ion/platform/device/display.c +++ b/ion/platform/device/display.c @@ -18,6 +18,7 @@ #include #include +#include #include "display/gpio.h" #include "display/spi.h" @@ -40,6 +41,8 @@ void ion_display_off() { } void init_display() { + assert(FRAMEBUFFER_LENGTH == (FRAMEBUFFER_WIDTH*FRAMEBUFFER_HEIGHT*FRAMEBUFFER_BITS_PER_PIXEL)/8); + display_gpio_init(); display_spi_init(); @@ -57,9 +60,5 @@ void init_display() { memset(FRAMEBUFFER_ADDRESS, 0, FRAMEBUFFER_LENGTH); - for (int i=0;i<10;i++) { - ion_set_pixel(i,i,0x3); - } - display_dma_init(); } diff --git a/ion/platform/device/display/dma.c b/ion/platform/device/display/dma.c index 91ef475da..65b91260f 100644 --- a/ion/platform/device/display/dma.c +++ b/ion/platform/device/display/dma.c @@ -38,7 +38,8 @@ void display_dma_init() { // 9 - Data transfer direction, peripheral/memory increment, single burst or transaction, peripheral and memory data width REGISTER_SET_VALUE(DMA_SCR(DMA1,LCD_DMA_STREAM), DMA_DIR, DMA_DIR_MEMORY_TO_PERIPHERAL); - //DMA_SCR(DMA1,LCD_DMA_STREAM) |= DMA_CIRC; + + DMA_SCR(DMA1,LCD_DMA_STREAM) |= DMA_CIRC; // Memory address is incremented DMA_SCR(DMA1,LCD_DMA_STREAM) |= DMA_MINC; @@ -51,4 +52,9 @@ void display_dma_init() { // 11 - Bonux: enable DMA requests on SPI SPI_CR2(SPI2) |= SPI_TXDMAEN; + + /*while (DMA_SCR(DMA1,LCD_DMA_STREAM) & DMA_EN) { + } + DMA_SCR(DMA1,LCD_DMA_STREAM) |= DMA_EN; + */ } diff --git a/ion/platform/device/framebuffer.h b/ion/platform/device/framebuffer.h index d3b8f079d..6031330d4 100644 --- a/ion/platform/device/framebuffer.h +++ b/ion/platform/device/framebuffer.h @@ -3,6 +3,6 @@ extern char _framebuffer_end; #define FRAMEBUFFER_ADDRESS (&_framebuffer_start) #define FRAMEBUFFER_LENGTH (&_framebuffer_end-&_framebuffer_start) -#define FRAMEBUFFER_WIDTH 160 +#define FRAMEBUFFER_WIDTH 240 #define FRAMEBUFFER_HEIGHT 160 #define FRAMEBUFFER_BITS_PER_PIXEL 4 diff --git a/src/hello.cpp b/src/hello.cpp index 34e4b2f1d..dd335d337 100644 --- a/src/hello.cpp +++ b/src/hello.cpp @@ -8,6 +8,9 @@ extern "C" { #include void hello() { + + KDDrawString("Hello, world!", (KDPoint){.x = x, .y = 10}); + char input[255]; int index = 0;