|
Don't worry, people who are paid to do work, introduce bugs in their paid time, true story!
|
|
|
|
|
Yeah but the next thing I have on my plate for work is bugfixing!
Real programmers use butterflies
|
|
|
|
|
You can't fix bugs if you don't write a few first.
|
|
|
|
|
Such wisdom!
|
|
|
|
|
You've obviously never had the misfortune of being part of the team like the one I was, a few years back.
It would've been fine if I was the silly monkey writing all the bugs...
Hate to imagine what being a medical doctor feels like!
|
|
|
|
|
Good morning,
honey the codewitch wrote: I try to get my SPI driver working, and I have massive timing problems. I'm looking at your st7789 code[^] and I don't see how it could ever work reliably in its current state. But it also looks like a relatively easy fix.
The datasheet[^] has a section labled 'Parallel Interface Timing Characteristics' which has a table containing the min/max wait and hold times. Why can't you just add a delay parameter to your command and data functions[^] and use os_delay_us() to wait for the period + hold.
Or you could just try taking the largest wait time and always wait for the maximum. For example, the largest write wait time I see in the st7789 datasheet appears to be 16ns.
Best Wishes,
-David Delaune
|
|
|
|
|
Here's the thing.
If I insert pauses between all my commands, my code will be the only code on the Internet that does that.
Seriously.
This code is basically copied, pasted, and the function names cleaned up - from a working library.
Now, I can insert delays to make my code slower.
But I darn well want to know why my code is the only one that needs delays.
Edit: I put delays everywhere. Same problem. *headdesk*
Real programmers use butterflies
modified 19-Dec-21 6:23am.
|
|
|
|
|
Hi,
honey the codewitch wrote: If I insert pauses between all my commands, my code will be the only code on the Internet that does that.
Are you sure about that? Look how the reference library you copied code from uses SPI_FREQUENCY[^] Also look at the busy-wait around the SPIBUSY[^] bits.
|
|
|
|
|
That's not an extra pause. That's just polling for the SPI transfer to complete, and my code does it too.
Here's how I write a byte:
*_spi_mosi_dlen = 7;
*_spi_w = value;
*_spi_cmd = SPI_USR;
while (*_spi_cmd & SPI_USR);
The only difference here is I'm referencing the registers via a volatile static member - but his code does that too - look at the different #ifdef paths. Also I'm using SPI_USR which is how you poll on an ESP32. I don't think you use the busy flag on this platform. not even sure it's defined. (he has different code files for different processors)
I use the frequency as well. It's a template argument to tft_spi<>
Real programmers use butterflies
|
|
|
|
|
Alright,
Well, I don't see anything else that stands out. You might need to figure this one out yourself. Unless you can find someone with similar hardware to take a look.
Best Wishes,
David Delaune
|
|
|
|
|
Yeah, that's where I'm at. I didn't figure on any help here, or I would have posted it in programming questions. I was just venting.
Real programmers use butterflies
|
|
|
|
|
Ok,
I thought I saw someone in the esp32 sub offer to test for you the other day. Maybe you should take up the offer.
|
|
|
|
|
Thanks. I must have missed it. I'll recheck my posts.
Real programmers use butterflies
|
|
|
|
|
I only bring this up because this post is so current (12/16/2021), succinct (18 minutes), and yet so comprehensive.
Xamarin.Forms Quickstart Deep Dive - Xamarin | Microsoft Docs
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
|
I appreciate things that are current, well written and relevant (IOS; Android; UWP; mobile). I gave my reason for posting it. What more do you need?
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I used to. And hopefully I will again.
|
|
|
|
|
The Kinks, A Gallon Of Gas:
The Kinks - A Gallon Of Gas - YouTube[^]
[Edit]
I remember my first time in US before about 30 years. We joinend Los Angeles up to San Francisco with a camper. We payed sometething around $1 for one gallon. In my country we received 1L for that cash
Btw. 1 Gallon is about 3.79L
[Edit]
Currently US (google): $1 per Gallon$3.5 / Gallone
Here about: $2 per Liter
modified 18-Dec-21 15:12pm.
|
|
|
|
|
Yes and before
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
|
The young ones over here only remember laughing gas
|
|
|
|
|
I remember gas at major chains being below a dollar a gallon. I also vaguely remember the last time I was at a gas station.
|
|
|
|
|
My first purchase of gas was .34/gal. when I bought my first car in 68.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
It is all relative. When I first started driving, gas was less than $0.20 a gallon. I remember disappointment when I no longer got 5 gallons for a dollar.
Gas wars in New Jersey brought it down to $0.11 a gallon at times.
Some stations gave green stamps or a water glass for a fill-up.
OTOH, most entry level jobs paid about $0.65 an hour (my first one paid less).
On the nostalgic side, when I was about 14 I visited my grand father in Canada. Had a cabin in the sticks. Post Office/general store/gas station had one of the old time pumps where you hand pumped the gas up into a jar (held 5 gallons) until you got what you wanted and then released into the tank. Probably imperial gallons, don't remember that far back. I have CRS (can't remember stuff).
>64
If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.
|
|
|
|
|
I remember gas in Canada being 49.9c/gallon in 1967. That's an imperial gallon (4.54 liters). I was 10 years old and had started to notice prices.
Today, gas is C$1.39/liter. But a silver 50c piece from 1967, the last year in which Canada issued silver coins, would still buy a gallon of gas, despite all the increases in gas taxes. The price of gas hasn't gone up. Instead, the currency has been debauched.
|
|
|
|