Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change init for KeDei 3.5" 480x320 V6.3 2018/4/9 #76

Open
wants to merge 62 commits into
base: master
Choose a base branch
from

Conversation

kpishere
Copy link

Messed up the last one and caused it to close. Oops.

This is same as prior one.

#71

@juj
Copy link
Owner

juj commented Mar 26, 2019

Thanks for the PR, much appreciated. I'll keep this around for a bit before landing, until I find a spot to be able to test this against the KeDei display I have. The original code was implemented via reverse engineering to be bit to bit compatible with the protocol that original driver was sending, so needs a bit of testing to verify if the new code works for both my and your displays, or if there will be a need to have two init sequence options.

mpi3501.cpp Outdated Show resolved Hide resolved
mpi3501.cpp Outdated Show resolved Hide resolved
mpi3501.cpp Outdated Show resolved Hide resolved
@kpishere
Copy link
Author

juj: i believe this is now in good state. wanna give it a try on your device? check if i have broken any other touch screen variants?

@juj
Copy link
Owner

juj commented May 31, 2019

Very impressive work! Unfortunately due to logistics reasons I don't currently have access to any of my Pis to test. Saw you comment on the other issue thread, I hope there are some people there who find interest to try it out.

@neuromancer85
Copy link

Hi @kpishere, I'm trying to build your fork on my rpi for a touchscreen based on Waveshare 3.5" 480x320 ILI9486 display (-DWAVESHARE35B_ILI9486=ON). Unfortunately the build is broken:

pi@raspberrypi3A:~/fbcp-ili9341/build $ cmake -DWAVESHARE35B_ILI9486=ON -DSPI_BUS_CLOCK_DIVISOR=24 -DARMV8A=ON -DBACKLIGHT_CONTROL=ON -DSTATISTICS=0 -DDISPLAY_BREAK_ASPECT_RATIO_WHEN_SCALING=ON ..
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Doing a Release build
-- Board revision: 9020e0
CMake Warning at CMakeLists.txt:40 (message):
  The board revision of this hardware is not known.  Please add detection to
  this board in CMakeLists.txt.  (proceeding to compile against a generic
  multicore CPU)

-- Enabling optimization flags that target ARMv8-A instruction set (Pi 2B >= rev. 1.2, 3B, 3B+, CM3 or CM3 lite)
-- Enabling fbcp-ili9341 backlight control
-- Scaling source image to view. If the HDMI resolution does not match the SPI display resolution, this will produce blurriness. Match the HDMI display resolution with the SPI resolution in /boot/config.txt to get crisp pixel perfect rendering, or alternatively pass -DDISPLAY_CROPPED_INSTEAD_OF_SCALING=ON to crop instead of scale if you want to view the center of the screen pixel perfect when HDMI and SPI resolutions do not match.
-- Ignoring aspect ratio when scaling source image to the SPI display (Pass -DDISPLAY_BREAK_ASPECT_RATIO_WHEN_SCALING=OFF to preserve aspect ratio)
-- SPI_BUS_CLOCK_DIVISOR set to 24. Try setting this to a higher value (must be an even number) if this causes problems. Display update speed = core_freq/divisor. (on Pi3B, by default core_freq=400). A safe starting default value may be -DSPI_BUS_CLOCK_DIVISOR=40
-- USE_DMA_TRANSFERS enabled, this improves performance. Try running CMake with -DUSE_DMA_TRANSFERS=OFF it this causes problems, or try adjusting the DMA channels to use with -DDMA_TX_CHANNEL=<num> -DDMA_RX_CHANNEL=<num>.
-- Targeting WaveShare 3.5 inch (B) display with ILI9486
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/fbcp-ili9341/build
pi@raspberrypi3A:~/fbcp-ili9341/build $ make -j
Scanning dependencies of target fbcp-ili9341
[  5%] Building CXX object CMakeFiles/fbcp-ili9341.dir/diff.cpp.o
[ 10%] Building CXX object CMakeFiles/fbcp-ili9341.dir/display.cpp.o
[ 15%] Building CXX object CMakeFiles/fbcp-ili9341.dir/XPT2046.cpp.o
[ 20%] Building CXX object CMakeFiles/fbcp-ili9341.dir/dma.cpp.o
[ 25%] Building CXX object CMakeFiles/fbcp-ili9341.dir/fbcp-ili9341.cpp.o
[ 30%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ili9486.cpp.o
[ 55%] Building CXX object CMakeFiles/fbcp-ili9341.dir/hx8357d.cpp.o
[ 55%] Building CXX object CMakeFiles/fbcp-ili9341.dir/gpu.cpp.o
[ 55%] Building CXX object CMakeFiles/fbcp-ili9341.dir/keyboard.cpp.o
[ 55%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ili9341.cpp.o
[ 55%] Building CXX object CMakeFiles/fbcp-ili9341.dir/st7735r.cpp.o
[ 60%] Building CXX object CMakeFiles/fbcp-ili9341.dir/spi.cpp.o
[ 65%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mz61581.cpp.o
[ 70%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ssd1351.cpp.o
[ 75%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mpi3501.cpp.o
[ 80%] Building CXX object CMakeFiles/fbcp-ili9341.dir/statistics.cpp.o
[ 85%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mem_alloc.cpp.o
[ 90%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mailbox.cpp.o
[ 95%] Building CXX object CMakeFiles/fbcp-ili9341.dir/text.cpp.o
/home/pi/fbcp-ili9341/dma.cpp:129:0: warning: "VIRT_TO_BUS" redefined
 #define VIRT_TO_BUS(block, x) ((uintptr_t)(x) - (uintptr_t)((block).virtualAddr) + (block).busAddress)
 
In file included from /home/pi/fbcp-ili9341/dma.cpp:8:0:
/home/pi/fbcp-ili9341/spi_kernel.h:7:0: note: this is the location of the previous definition
 #define VIRT_TO_BUS(ptr) ((uintptr_t)(ptr) | 0xC0000000U)
 
In file included from /home/pi/fbcp-ili9341/spi_kernel.h:3:0,
                 from /home/pi/fbcp-ili9341/dma.cpp:8:
/home/pi/fbcp-ili9341/spi.h:50:12: error: ?DMAControlBlock? does not name a type
   volatile DMAControlBlock cb[2];
            ^~~~~~~~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp: In function ?int InitDMA()?:
/home/pi/fbcp-ili9341/dma.cpp:218:56: error: ?bcm2835? was not declared in this scope
   dma0 = (volatile DMAChannelRegisterFile*)((uintptr_t)bcm2835 + BCM2835_DMA0_OFFSET);
                                                        ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:243:47: error: ?SHARED_MEMORY_SIZE? was not declared in this scope
   dmaSourceBuffer = AllocateUncachedGpuMemory(SHARED_MEMORY_SIZE*2, "DMA source data");
                                               ^~~~~~~~~~~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp: In function ?void DumpDMAState()?:
/home/pi/fbcp-ili9341/dma.cpp:352:13: error: ?spi? was not declared in this scope
   DumpSPICS(spi->cs);
             ^~~
/home/pi/fbcp-ili9341/dma.cpp:352:20: error: ?DumpSPICS? was not declared in this scope
   DumpSPICS(spi->cs);
                    ^
/home/pi/fbcp-ili9341/dma.cpp: In function ?void WaitForDMAFinished()?:
/home/pi/fbcp-ili9341/dma.cpp:375:22: error: ?tick? was not declared in this scope
   uint64_t t0 = tick();
                      ^
/home/pi/fbcp-ili9341/dma.cpp:378:15: error: ?usleep? was not declared in this scope
     usleep(100);
               ^
/home/pi/fbcp-ili9341/dma.cpp:390:15: error: ?usleep? was not declared in this scope
     usleep(100);
               ^
/home/pi/fbcp-ili9341/dma.cpp: In function ?void SPIDMATransfer(SPITask*)?:
/home/pi/fbcp-ili9341/dma.cpp:677:3: error: ?spi? was not declared in this scope
   spi->cs = BCM2835_SPI0_CS_DMAEN | BCM2835_SPI0_CS_CLEAR | DISPLAY_SPI_DRIVE_SETTINGS;
   ^~~
/home/pi/fbcp-ili9341/dma.cpp:677:61: error: ?DISPLAY_SPI_DRIVE_SETTINGS? was not declared in this scope
   spi->cs = BCM2835_SPI0_CS_DMAEN | BCM2835_SPI0_CS_CLEAR | DISPLAY_SPI_DRIVE_SETTINGS;
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:678:30: error: invalid use of incomplete type ?SPITask {aka struct SPITask}?
   uint32_t *headerAddr = task->DmaSpiHeaderAddress();
                              ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:0:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ?SPITask {aka struct SPITask}?
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:679:72: error: invalid use of incomplete type ?SPITask {aka struct SPITask}?
   *headerAddr = BCM2835_SPI0_CS_TA | DISPLAY_SPI_DRIVE_SETTINGS | (task->PayloadSize() << 16); // The first four bytes written to the SPI data register control the DLEN and CS,CPOL,CPHA settings.
                                                                        ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:0:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ?SPITask {aka struct SPITask}?
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:685:55: error: invalid use of incomplete type ?SPITask {aka struct SPITask}?
   memcpy(dmaSourceBuffer.virtualAddr, headerAddr, task->PayloadSize() + 4);
                                                       ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:0:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ?SPITask {aka struct SPITask}?
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:692:19: error: invalid use of incomplete type ?SPITask {aka struct SPITask}?
   txcb->len = task->PayloadSize() + 4;
                   ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:0:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ?SPITask {aka struct SPITask}?
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:703:19: error: invalid use of incomplete type ?SPITask {aka struct SPITask}?
   rxcb->len = task->PayloadSize();
                   ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:0:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ?SPITask {aka struct SPITask}?
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:715:33: error: invalid use of incomplete type ?SPITask {aka struct SPITask}?
   double pendingTaskUSecs = task->PayloadSize() * spiUsecsPerByte;
                                 ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:0:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ?SPITask {aka struct SPITask}?
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:717:31: error: ?usleep? was not declared in this scope
     usleep(pendingTaskUSecs-70);
                               ^
/home/pi/fbcp-ili9341/dma.cpp:719:32: error: ?tick? was not declared in this scope
   uint64_t dmaTaskStart = tick();
                                ^
CMakeFiles/fbcp-ili9341.dir/build.make:134: set di istruzioni per l'obiettivo "CMakeFiles/fbcp-ili9341.dir/dma.cpp.o" non riuscito
make[2]: *** [CMakeFiles/fbcp-ili9341.dir/dma.cpp.o] Errore 1
make[2]: *** Attesa per i processi non terminati....
CMakeFiles/Makefile2:67: set di istruzioni per l'obiettivo "CMakeFiles/fbcp-ili9341.dir/all" non riuscito
make[1]: *** [CMakeFiles/fbcp-ili9341.dir/all] Errore 2
Makefile:83: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2

At the moment I'm going to fork your repo and trying to add touch support to my display variant since it has the same touch controller as your screen.

@neuromancer85
Copy link

I've made some changes in my fork https://github.com/neuromancer85/fbcp-ili9341/tree/ili9486_touch_support.
At the moment fbcp-ili9341 builds and runs again, I can see the desktop on the display!
However the touch support is still not working... I'll try to poke around with the code later.

@kpishere
Copy link
Author

@neuromancer85 yeah, touch sensing is only active right now when the display is being updated. this is no good for gui displays that mostly are still. I'm trying to find the the spot where the program sleeps .. you'd think it is not that hard but I'm really having an issue with it. My build parameters are

cmake -DSPI_BUS_CLOCK_DIVISOR=12 -DKEDEI_V63_MPI3501=ON -DDISPLAY_ROTATE_180_DEGREES=ON -DSTATISTICS=0 ..

for my display. I have a timer that polls the touch display driver and this works OK, but I need to activate/deactivate the timer at the correct points so that it does not interfere when the display is being written to.

I'll check in what I have and maybe you can look too? Currently, I've got a bunch of printf() statements in it to just get sense of where it is.

@kpishere
Copy link
Author

Actually ... resorting to good'ol 'strace'. .. yielded some clues .. there is a non-blocking read somewhere that it is in ...

read(5, "52926\n", 21) = 6
lseek(5, 0, SEEK_SET) = 0
read(5, "52926\n", 21) = 6
lseek(5, 0, SEEK_SET) = 0
read(5, "52926\n", 21) = 6
lseek(5, 0, SEEK_SET) = 0
futex(0xb4aaa00c, FUTEX_WAKE, 1) = 0
read(5, "52926\n", 21) = 6
lseek(5, 0, SEEK_SET) = 0
read(5, "52926\n", 21) = 6
lseek(5, 0, SEEK_SET) = 0
read(5, "52926\n", 21) = 6
lseek(5, 0, SEEK_SET) = 0
read(5, "52926\n", 21) = 6
lseek(5, 0, SEEK_SET) = 0
...

@kpishere
Copy link
Author

@juj I'm throwing in the towel on this one. I can't slow down the binary drivers provided by Kedei, my scope isn't fast enough (200Mhz) to get a clear profile of the signals and my sampling depth is small. Unless somebody else can provide a sampling with a signal analyzer from a driver that actually turns off the backlight, I'm done with this. I'm simply going to leave display on all the time and black-out the display during inactive times -- it will be on all the time. Clearly no good for battery applications but oh well, moving on with my project. It has been fun getting into the nitty gritty of displays ... once you learn one, the others are all very similar in this small-display space.

@juj
Copy link
Owner

juj commented Oct 2, 2019

Neat work on this one! I hope people find it useful. There is unfortunately trouble to merge this, because the code has an incompatible LGPL license (https://github.com/juj/fbcp-ili9341/pull/76/files#diff-cef9e6445e53afd359ed1bcfe1ad3cddR10). Absolutely great to have this project for people who need touch as well, and do not have any limitations on choosing a license.

@kpishere
Copy link
Author

kpishere commented Oct 2, 2019

Hmm. Good point @juj I'll ask Markus what he thinks.

ref: Links2004/XPT2046#3

@Links2004
Copy link

Hi,

looks like a interesting project you are running here.
I am fine to re license my code under MIT for this Project.

I changed the license and created a PR:
kpishere#1

kpishere and others added 10 commits October 2, 2019 15:32
* missing ignore for tcTest added
* library changed to use EGL and GLESv2 from libraspberrypi0 package.
* make - builds the kernel module
* make install - installs the kernel module
* make uninstall - uninstalls the kernel module
* make start - loads the module
* make stop - stops fbcp-ili9341 process and unloads the module
* make status - shows module info and if loaded in kernel
* make debug - generates disassembly output for debugging
* make clean - remove all files generates by this Makefile
The clean-rule in the makefile tried to create the object files before
removing them. Additionally tcTest was not handled correct in
clean-rule.
some cosmetic changes for the util part:
full fletched Makefile for kernel with features:
The complex part is that on one side a linux module should be
created with dkms. On the other sider there is a binary which
needs to be compiled on package install because it depends on
the installed hardware. For compilation the user has to provide
some additional information, which is fetched via config-package
questions and answers.
Besides this some small test and calibration binaries are created
during the package build process.

Could only test this with my single hardware (KeDei) and hope
that it works similar with the other types of displays/touchscreens.
A first try to configure the repo for building a debian package.
@zerog2k
Copy link

zerog2k commented Jan 3, 2020

@kpishere looks like there are conflicts ?

@juj juj mentioned this pull request Feb 10, 2020
@tousisat
Copy link

tousisat commented Feb 10, 2020

Hello, thank you a lot for all your contribution. I'm currently trying to run this pull request but got errors when sudo make -j
I have a waveshare 3.5 inch display model B rev2 (https://www.waveshare.com/product/3.5inch-rpi-lcd-b.htm)
Here is what I did on my Rpi4 (4GB of ram):
git fetch origin pull/76/head:pr-76
git checkout pr-76
cd ./fbcp-ili9341
mkdir build
cd build
sudo cmake -DSPI_BUS_CLOCK_DIVISOR=50 -DWAVESHARE35B_ILI9486=ON -DDISPLAY_INVERT_COLORS=ON -DUSE_DMA_TRANSFERS=ON -DSTATISTICS=0 -DDMA_TX_CHANNEL=4 -DDMA_RX_CHANNEL=5 ..
sudo make -j

And it fails..

Scanning dependencies of target fbcp-ili9341
[  4%] Building CXX object CMakeFiles/fbcp-ili9341.dir/display.cpp.o
[  9%] Building CXX object CMakeFiles/fbcp-ili9341.dir/fbcp-ili9341.cpp.o
[ 14%] Building CXX object CMakeFiles/fbcp-ili9341.dir/calibrate.cpp.o
[ 19%] Building CXX object CMakeFiles/fbcp-ili9341.dir/diff.cpp.o
[ 23%] Building CXX object CMakeFiles/fbcp-ili9341.dir/XPT2046.cpp.o
[ 28%] Building CXX object CMakeFiles/fbcp-ili9341.dir/gpu.cpp.o
[ 33%] Building CXX object CMakeFiles/fbcp-ili9341.dir/dma.cpp.o
[ 38%] Building CXX object CMakeFiles/fbcp-ili9341.dir/hx8357d.cpp.o
[ 42%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ili9486.cpp.o
[ 47%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ili9341.cpp.o
[ 52%] Building CXX object CMakeFiles/fbcp-ili9341.dir/keyboard.cpp.o
[ 57%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mem_alloc.cpp.o
[ 61%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mailbox.cpp.o
[ 66%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mpi3501.cpp.o
[ 71%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mz61581.cpp.o
/home/pi/fbcp-ili9341/dma.cpp:129: warning: "VIRT_TO_BUS" redefined
 #define VIRT_TO_BUS(block, x) ((uintptr_t)(x) - (uintptr_t)((block).virtualAddr) + (block).busAddress)
 
In file included from /home/pi/fbcp-ili9341/dma.cpp:8:
/home/pi/fbcp-ili9341/spi_kernel.h:7: note: this is the location of the previous definition
 #define VIRT_TO_BUS(ptr) ((uintptr_t)(ptr) | 0xC0000000U)
 
[ 76%] Building CXX object CMakeFiles/fbcp-ili9341.dir/spi.cpp.o
[ 80%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ssd1351.cpp.o
[ 85%] Building CXX object CMakeFiles/fbcp-ili9341.dir/statistics.cpp.o
[ 90%] Building CXX object CMakeFiles/fbcp-ili9341.dir/st7735r.cpp.o
[ 95%] Building CXX object CMakeFiles/fbcp-ili9341.dir/text.cpp.o
In file included from /home/pi/fbcp-ili9341/spi_kernel.h:3,
                 from /home/pi/fbcp-ili9341/dma.cpp:8:
/home/pi/fbcp-ili9341/spi.h:50:12: error: ‘DMAControlBlock’ does not name a type
   volatile DMAControlBlock cb[2];
            ^~~~~~~~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp: In function ‘int InitDMA()’:
/home/pi/fbcp-ili9341/dma.cpp:218:56: error: ‘bcm2835’ was not declared in this scope
   dma0 = (volatile DMAChannelRegisterFile*)((uintptr_t)bcm2835 + BCM2835_DMA0_OFFSET);
                                                        ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:243:47: error: ‘SHARED_MEMORY_SIZE’ was not declared in this scope
   dmaSourceBuffer = AllocateUncachedGpuMemory(SHARED_MEMORY_SIZE*2, "DMA source data");
                                               ^~~~~~~~~~~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp: In function ‘void DumpDMAState()’:
/home/pi/fbcp-ili9341/dma.cpp:352:13: error: ‘spi’ was not declared in this scope
   DumpSPICS(spi->cs);
             ^~~
/home/pi/fbcp-ili9341/dma.cpp:352:3: error: ‘DumpSPICS’ was not declared in this scope
   DumpSPICS(spi->cs);
   ^~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:352:3: note: suggested alternative: ‘DumpCS’
   DumpSPICS(spi->cs);
   ^~~~~~~~~
   DumpCS
/home/pi/fbcp-ili9341/dma.cpp: In function ‘void WaitForDMAFinished()’:
/home/pi/fbcp-ili9341/dma.cpp:375:17: error: ‘tick’ was not declared in this scope
   uint64_t t0 = tick();
                 ^~~~
/home/pi/fbcp-ili9341/dma.cpp:378:5: error: ‘usleep’ was not declared in this scope
     usleep(100);
     ^~~~~~
/home/pi/fbcp-ili9341/statistics.cpp: In function ‘int InitStatistics()’:
/home/pi/fbcp-ili9341/statistics.cpp:290:23: warning: no return statement in function returning non-void [-Wreturn-type]
 int InitStatistics() {}
                       ^
/home/pi/fbcp-ili9341/dma.cpp:378:5: note: suggested alternative: ‘fseek’
     usleep(100);
     ^~~~~~
     fseek
/home/pi/fbcp-ili9341/dma.cpp:390:5: error: ‘usleep’ was not declared in this scope
     usleep(100);
     ^~~~~~
/home/pi/fbcp-ili9341/dma.cpp:390:5: note: suggested alternative: ‘fseek’
     usleep(100);
     ^~~~~~
     fseek
/home/pi/fbcp-ili9341/dma.cpp: In function ‘void SPIDMATransfer(SPITask*)’:
/home/pi/fbcp-ili9341/dma.cpp:677:3: error: ‘spi’ was not declared in this scope
   spi->cs = BCM2835_SPI0_CS_DMAEN | BCM2835_SPI0_CS_CLEAR | DISPLAY_SPI_DRIVE_SETTINGS;
   ^~~
/home/pi/fbcp-ili9341/dma.cpp:677:61: error: ‘DISPLAY_SPI_DRIVE_SETTINGS’ was not declared in this scope
   spi->cs = BCM2835_SPI0_CS_DMAEN | BCM2835_SPI0_CS_CLEAR | DISPLAY_SPI_DRIVE_SETTINGS;
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:678:30: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
   uint32_t *headerAddr = task->DmaSpiHeaderAddress();
                              ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:679:72: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
   *headerAddr = BCM2835_SPI0_CS_TA | DISPLAY_SPI_DRIVE_SETTINGS | (task->PayloadSize() << 16); // The first four bytes written to the SPI data register control the DLEN and CS,CPOL,CPHA settings.
                                                                        ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:685:55: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
   memcpy(dmaSourceBuffer.virtualAddr, headerAddr, task->PayloadSize() + 4);
                                                       ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:692:19: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
   txcb->len = task->PayloadSize() + 4;
                   ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:703:19: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
   rxcb->len = task->PayloadSize();
                   ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:715:33: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
   double pendingTaskUSecs = task->PayloadSize() * spiUsecsPerByte;
                                 ^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
 typedef struct SPITask SPITask;
                ^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:717:5: error: ‘usleep’ was not declared in this scope
     usleep(pendingTaskUSecs-70);
     ^~~~~~
/home/pi/fbcp-ili9341/dma.cpp:717:5: note: suggested alternative: ‘fseek’
     usleep(pendingTaskUSecs-70);
     ^~~~~~
     fseek
/home/pi/fbcp-ili9341/dma.cpp:719:27: error: ‘tick’ was not declared in this scope
   uint64_t dmaTaskStart = tick();
                           ^~~~
/home/pi/fbcp-ili9341/dma.cpp:719:27: note: suggested alternative: ‘txcb’
   uint64_t dmaTaskStart = tick();
                           ^~~~
                           txcb
make[2]: *** [CMakeFiles/fbcp-ili9341.dir/build.make:115: CMakeFiles/fbcp-ili9341.dir/dma.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/pi/fbcp-ili9341/spi.cpp: In function ‘void sendNoOpCommand()’:
/home/pi/fbcp-ili9341/spi.cpp:285:15: warning: unsigned conversion from ‘int’ to ‘uint8_t’ {aka ‘unsigned char’} changes value from ‘4352’ to ‘0’ [-Woverflow]
   task->cmd = 0x00001100;
               ^~~~~~~~~~
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/fbcp-ili9341.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Can someone help me out. I really would like to add touch feature!
Thank you in advance
Raphael Bridi

@juj juj mentioned this pull request Apr 3, 2020
@sam-dyer
Copy link

@tousisat have you had any luck, I am trying to get it to work on the same stuff as you.

@tousisat
Copy link

@tousisat have you had any luck, I am trying to get it to work on the same stuff as you.

Unfortunaletly not, I ended up using the fbcp without touch :/

@juj juj mentioned this pull request May 22, 2020
@kpishere
Copy link
Author

Hi Y'all, just an FYI, I 'trick' for getting around no activity in display and having responsiveness in the screen is to show a cursor in the application level. Hence, you're doing screen updates as you touch. @juj suggested sending a no-op command to display but that would interfere with optimization that he has worked so hard on. I think I have a demo app in my branch that does this. If you're wondering why demo works and your app does not, this would by why. Need to draw the cursor in the application layer logic.

@Titaniumtown
Copy link

Will this be rebased any time soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants