@@ -41,7 +41,7 @@ static uint32_t writeCounter = 0;
4141 TOGGLE_CHIP_SELECT_LINE (); \
4242 DEBUG_PRINT_WRITTEN_BYTE (w); \
4343 } while (0 )
44-
44+
4545int mem_fd = -1 ;
4646volatile void *bcm2835 = 0 ;
4747volatile GPIORegisterFile *gpio = 0 ;
@@ -322,7 +322,6 @@ void RunSPITask(SPITask *task)
322322
323323 SET_GPIO (GPIO_TFT_DATA_CONTROL);
324324#endif
325-
326325 // Send the data payload:
327326 while (tStart < tPrefillEnd) WRITE_FIFO (*tStart++);
328327 while (tStart < tEnd)
@@ -338,6 +337,11 @@ void RunSPITask(SPITask *task)
338337}
339338#else
340339
340+ #ifdef KEDEI_TRASH
341+ extern void lcd_data8 (uint8_t *data);
342+ extern void lcd_cmd (uint8_t data);
343+ #endif
344+
341345void RunSPITask (SPITask *task)
342346{
343347 WaitForPolledSPITransferToFinish ();
@@ -355,6 +359,15 @@ void RunSPITask(SPITask *task)
355359 const uint32_t payloadSize = tEnd - tStart;
356360 uint8_t *tPrefillEnd = tStart + MIN (15 , payloadSize);
357361
362+ #ifdef KEDEI_TRASH
363+ lcd_cmd (task->cmd );
364+ while (tStart < tEnd)
365+ {
366+ lcd_data8 (tStart);
367+ tStart += 2 ;
368+ }
369+ #else // not KEDEI_TRASH
370+
358371 // Send the command word if display is 4-wire (3-wire displays can omit this, commands are interleaved in the data payload stream above)
359372#ifndef SPI_3WIRE_PROTOCOL
360373 // An SPI transfer to the display always starts with one control (command) byte, followed by N data bytes.
@@ -365,7 +378,6 @@ void RunSPITask(SPITask *task)
365378 WRITE_FIFO (0x00 );
366379#endif
367380 WRITE_FIFO (task->cmd );
368-
369381#ifdef DISPLAY_SPI_BUS_IS_16BITS_WIDE
370382 while (!(spi->cs & (BCM2835_SPI0_CS_DONE))) /* nop*/ ;
371383 spi->fifo ;
@@ -393,7 +405,11 @@ void RunSPITask(SPITask *task)
393405 else
394406#endif
395407 {
396- while (tStart < tPrefillEnd) WRITE_FIFO (*tStart++);
408+ while (tStart < tPrefillEnd)
409+ {
410+ WRITE_FIFO (*tStart++);
411+
412+ }
397413 while (tStart < tEnd)
398414 {
399415 uint32_t cs = spi->cs ;
@@ -402,10 +418,12 @@ void RunSPITask(SPITask *task)
402418 if ((cs & (BCM2835_SPI0_CS_RXR|BCM2835_SPI0_CS_RXF))) spi->cs = BCM2835_SPI0_CS_CLEAR_RX | BCM2835_SPI0_CS_TA | DISPLAY_SPI_DRIVE_SETTINGS;
403419 }
404420 }
421+ #endif // not KEDEI_TRASH
405422
406423#ifdef DISPLAY_NEEDS_CHIP_SELECT_SIGNAL
407424 END_SPI_COMMUNICATION ();
408425#endif
426+
409427}
410428#endif
411429
0 commit comments