Mipi on SPI works.... but not with a big buffer.
This commit is contained in:
parent
37df583ec8
commit
61e3f1803b
|
@ -61,6 +61,6 @@ void app_main()
|
|||
if (err!=ESP_OK) printf("Couldn't map bootrom part!\n");
|
||||
printf("Starting emu...\n");
|
||||
// xTaskCreatePinnedToCore(&mouseTask, "mouse", 6*1024, NULL, 6, NULL, 0);
|
||||
xTaskCreatePinnedToCore(&emuTask, "emu", 6*1024, NULL, 5, NULL, 0);
|
||||
xTaskCreatePinnedToCore(&emuTask, "emu", 8*1024, NULL, 5, NULL, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -221,6 +221,8 @@ int findPixelVal(uint8_t *data, int x, int y) {
|
|||
volatile static uint8_t *currFbPtr=NULL;
|
||||
SemaphoreHandle_t dispSem = NULL;
|
||||
|
||||
#define LINESPERBUF 8
|
||||
|
||||
void IRAM_ATTR displayTask(void *arg) {
|
||||
|
||||
mipiInit();
|
||||
|
@ -238,22 +240,29 @@ void IRAM_ATTR displayTask(void *arg) {
|
|||
}
|
||||
|
||||
printf("Inited.\n");
|
||||
uint8_t img[641];
|
||||
uint8_t *img=malloc((LINESPERBUF*320*2)+1);
|
||||
assert(img);
|
||||
|
||||
while(1) {
|
||||
int l=0;
|
||||
mipiResync();
|
||||
xSemaphoreTake(dispSem, portMAX_DELAY);
|
||||
uint8_t *myData=(uint8_t*)currFbPtr;
|
||||
uint8_t img[641];
|
||||
img[0]=0x2c;
|
||||
uint8_t *p=&img[1];
|
||||
for (int j=0; j<320; j++) {
|
||||
uint8_t *p=&img[1];
|
||||
for (int i=0; i<320; i++) {
|
||||
int v=findPixelVal(myData, i, j);
|
||||
*p++=(v&0xff);
|
||||
*p++=(v>>8);
|
||||
}
|
||||
mipiDsiSendLong(0x39, img, sizeof(img)+4);
|
||||
img[0]=0x3c;
|
||||
l++;
|
||||
if (l>=LINESPERBUF || j==319) {
|
||||
//mipiDsiSendLong(0x39, img, (LINESPERBUF*320*2)+1);
|
||||
img[0]=0x3c;
|
||||
l=0;
|
||||
*p=&img[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ CONFIG_FATFS_MAX_LFN=255
|
|||
#
|
||||
# FreeRTOS
|
||||
#
|
||||
# CONFIG_FREERTOS_UNICORE is not set
|
||||
CONFIG_FREERTOS_UNICORE=y
|
||||
CONFIG_FREERTOS_CORETIMER_0=y
|
||||
# CONFIG_FREERTOS_CORETIMER_1 is not set
|
||||
CONFIG_FREERTOS_HZ=100
|
||||
|
@ -188,7 +188,7 @@ CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y
|
|||
# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set
|
||||
# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set
|
||||
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
|
||||
# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set
|
||||
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
|
||||
CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1
|
||||
CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y
|
||||
# CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set
|
||||
|
|
Loading…
Reference in New Issue