-
Notifications
You must be signed in to change notification settings - Fork 137
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
Replaced TFT_eSPI with LovyanGFX #94
Conversation
Replaced GFX library in preparation for rev 5. There should be no change in performance with SPI, but a huge improvement when using 8-bit in rev 5. Touch is now also handled by Lovyan with more direct harwdare access than the Adafruit library.
To me, the PR looks good. I tested both In
And I think, both in
|
Thanks for checking, Klaus! I thought I had seen driver_name in an example but yes, that's not used anywhere. |
You're welcome! You could also remove the driver_name and mcu_name from main_boardtest.cpp |
@CoretechR
You could test all red areas. The area in the bottom left corner does not work without the change. |
You are right, without the parameters there is an offset. Strange that this was not necessary with the Adafruit library.
|
Two more things: 1. Touch activity should reset timer
2. Problems going to sleep
|
Oh, I forgot about setLastActivityTimestamp_HAL. That should definitely remain in my_touchpad_read() like you suggested. I usually have the timout set very low so I did not notice that the device can't go to standby. Enabling bus_shared absolutely makes sense. Seems like an error that's hard to find later. Thank you! |
I still have problems with the device not going to sleep. I added some code to see what the IMU detects. Currently we have
With LovyanGFX and
I would suggest to set If you want to test by yourself:
Going to LovyanGFX
|
I see, cfg.bus_shared is meant for SPI not i2c. But what does this have to do with the IMU? Do you mean that we are too close to the threshold? If so, I don't mind increasing the value. I usually have a very low standby timeout set so outliers in the IMU values don't matter too much. But over a few minutes, that might be a problem. Usually that would mean filtering the IMU output, but changing the threshold is much easier. |
Exactly. First I thought there were very high outliers, but this is not the case. The values are only slightly higher. Don't know how this is related to the graphics library / touch library. Maybe the problem dissapears when switching to parallel transmisson. In my tests, |
I put a few print statements into activityDetection() and tested it:
A threshold of 50 is good enough for my remote if it is absolutely still. But just typing on my keyboard triggers the detection. Then again, holding it in one hand causes acceleration barely above the threshold. I think that's why I settled for the 50 value. Because at low timeout durations, normal hand motion keeps the device awake. I'll set it to 80 as a first step. |
BTW, LovyanGFX needs approx. 2,7k more memory compared to TFT_eSPI ... With the default configuration, now only 25.8k is left ... |
I replaced TFT_eSPI in preparation for rev 5. There should be no change in performance with SPI, but a huge improvement when using 8-bit in the upcoming rev 5.
Touch is now also handled by LovyanGFX with more direct harwdare access than the Adafruit library.