|
I can't rename the processor's SPI register constants.
Let me show you what I'm working with.
Frankly the variable names don't bother me. There aren't many variables, and I understand most of the class members like _csport and _dcport at this point. My main issue is the behavior of the registers. I have the manual but it reads like bad stereo instructions
#elif defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x
#define TCR_MASK \
(LPSPI_TCR_PCS(3) | LPSPI_TCR_FRAMESZ(31) | LPSPI_TCR_CONT | LPSPI_TCR_RXMSK)
void maybeUpdateTCR(
uint32_t requested_tcr_state) {
if ((_spi_tcr_current & TCR_MASK) != requested_tcr_state) {
bool dc_state_change = (_spi_tcr_current & LPSPI_TCR_PCS(3)) !=
(requested_tcr_state & LPSPI_TCR_PCS(3));
_spi_tcr_current = (_spi_tcr_current & ~TCR_MASK) | requested_tcr_state;
if (!dc_state_change || !_dcpinmask) {
while ((_pimxrt_spi->FSR & 0x1f))
;
_pimxrt_spi->TCR = _spi_tcr_current;
} else {
waitTransmitComplete();
if (requested_tcr_state & LPSPI_TCR_PCS(3))
DIRECT_WRITE_HIGH(_dcport, _dcpinmask);
else
DIRECT_WRITE_LOW(_dcport, _dcpinmask);
_pimxrt_spi->TCR = _spi_tcr_current &
~(LPSPI_TCR_PCS(3) |
LPSPI_TCR_CONT); }
}
}
void writecommand_cont(uint8_t c) __attribute__((always_inline)) {
maybeUpdateTCR(_tcr_dc_assert | LPSPI_TCR_FRAMESZ(7) );
_pimxrt_spi->TDR = c;
pending_rx_count++; waitFifoNotFull();
}
void writedata8_cont(uint8_t c) __attribute__((always_inline)) {
maybeUpdateTCR(_tcr_dc_not_assert | LPSPI_TCR_FRAMESZ(7) | LPSPI_TCR_CONT);
_pimxrt_spi->TDR = c;
pending_rx_count++; waitFifoNotFull();
}
void writedata16_cont(uint16_t d) __attribute__((always_inline)) {
maybeUpdateTCR(_tcr_dc_not_assert | LPSPI_TCR_FRAMESZ(15) | LPSPI_TCR_CONT);
_pimxrt_spi->TDR = d;
pending_rx_count++; waitFifoNotFull();
}
To err is human. Fortune favors the monsters.
|
|
|
|
|
honey the codewitch wrote: I can't rename the processor's SPI register constants. The magic of C++ macros allows any possibility! Have fun swearing!
|
|
|
|
|
Anarchy,
Open source is wierd. I took a look at the link you posted. It's a fork of a library written by Paul Stoffregen[^] under the MIT license.
Looking at that guys code reveals that it's yet another fork of the Adafruit library[^] with the BSD license removed.
So it looks like:
- Kurt (MIT licensed fork of PaulStoffregen)
- PaulStoffregen (MIT licensed fork of Adafruit)
- Adafruit original code is BSD licenced.
It honestly feels like you'd need an army of lawyers to use alot of open source code. I've always avoided it.
|
|
|
|
|
I'm aware of where it came from, and I'm very familiar with the Adafruit rendition.
The thing about Paul and Kurt's implementations is they are both optimized for the teensy, with Kurt's essentially being mostly the same as Paul's except with DMA.
The teensy specific stuff is what I'm copying. I need nothing from Adafruit, so as far as I'm concerned what I'm copying is MIT, as is what I wrote. If Adafruit wants to come at me, they can sure try. Otherwise, I feel like this is fair use.
Most of the IoT ecosystem is open source, so you either get used to it, or find another arena to develop in.
To err is human. Fortune favors the monsters.
|
|
|
|
|
#Worldle #222 2/6 (100%)
π©π©π©π¨β¬β¬
οΈ
π©π©π©π©π©π
https://worldle.teuteuf.fr
Todays Worldle will be dear to CP.
|
|
|
|
|
Quote: #Worldle #222 2/6 (100%)
π©π©π©π¨β¬β¬
οΈ
π©π©π©π©π©π
https://worldle.teuteuf.fr I'm just guessing we both went with the same first try!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
#Worldle #222 1/6 (100%)
π©π©π©π©π©π
https://worldle.teuteuf.fr
|
|
|
|
|
Too easy today
#Worldle #222 1/6 (100%)
π©π©π©π©π©π
https://worldle.teuteuf.fr
Happiness will never come to those who fail to appreciate what they already have. -Anon
|
|
|
|
|
I dont get all the 1/6! not a natural starter for me...
Wordle 438 6/6
β¬π©β¬π¨β¬
β¬β¬β¬β¬π©
π©π©π©β¬π©
π©π©π©β¬π©
π©π©π©β¬π©
π©π©π©π©π©
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
I consider CP to be sort of family - kudos or a's to Chris - he's Canadian, he'll get it.
I want all of you to look around or think of your loved ones - kids, wife, husband, etc and appreciate them. You do not know how long you will have them.
I buried my Mom in June. This morning, my younger sister passed. I have 3 sons in the USARMY - all tip of the spear stuff. I never saw this with my sister.
Yeah, it hurts like hell. Take a moment to count your blessings and hug loved ones.
elephant
Charlie Gilley
βThey who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.β BF, 1759
Has never been more appropriate.
|
|
|
|
|
Amen! And I'd include friends in that list as well. I lost one of my best friends 2 days ago...known him for many, many years, just like a brother to me. All we are promised is today, so use it well!
|
|
|
|
|
My close friend's younger brother, aged 53, passed away suddenly of heart attack. Nothing can be expected in this world.
|
|
|
|
|
Condolences
|
|
|
|
|
My condolences.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
A difficult part of life, my condolences.
Some time back, a good friend sent me this:
A Keeper
Their marriage was good, their dreams focused.
Their best friends lived barely a wave away.
I can see them now,
Dad in trousers, tee shirt and a hat and Mom in a house dress,
lawn mower in one hand, and dish-towel in the other.
It was the time for fixing things.
A curtain rod, the kitchen radio, screen door, the oven door, the hem in a dress.
Things we keep.
It was a way of life, and sometimes it made me crazy.
All that re-fixing, eating, renewing,
I wanted just once to be wasteful.
Waste meant affluence.
Throwing things away meant you knew there would always be more.
But then my mother died, and on that clear summer's night,
in the warmth of the hospital room,
I was struck with the pain of learning that sometimes there isn't any more.
Sometimes, what we care about most gets all used up and goes away...
never to return.
So... While we have it... it's best we love it...
And care for it.... And fix it when it's broken.....
And heal it when it's sick.
This is true...
For marriage....
And old cars....
And children with bad report cards.....
Dogs and cats with bad hips....
And aging parents....
And grandparents.
We keep them because they are worth it, because we are worth it.
Some things we keep.
Like a best friend that moved away or a classmate we grew up with.
There are just some things that make life important, like people we know who are special....
And so, we keep them close!
I received this from someone who thinks I am a 'keeper',
so I've sent it to the people I think of in the same way...
Good friends are like stars....
You don't always see them, but you know they are always there
People are made to be Loved and Things are made to be Used
There is so much confusion in this World because
People are being Used
and
Things are being Loved.
Be kind... everyone you meet is fighting a terrible battle.
Thanks for being part of MY life!
>64
Some days the dragon wins. Suck it up.
|
|
|
|
|
Well, I have one foot out the door and I'm Ok with that, but I would like to see my kids before I go. I asked my daughter if she's waiting for my funeral to see me again.
|
|
|
|
|
I'd like to talk to you privately but somehow that feature has been lost. Or I'm having a brain fart. It's been an elephanting tough 3 months.
we're on the forum, so I'm sure someone will chime in
Charlie Gilley
βThey who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.β BF, 1759
Has never been more appropriate.
|
|
|
|
|
I have known this since i lost my first brother at 35 and then my second at 35. I am safely past 35 now. past 50. But it still worries me each day for my children and my wife. I value each moment as much as i can. Life is short people
To err is human to really elephant it up you need a computer
|
|
|
|
|
Is driving me INSANE.
50% of the time I try and click on the left of a line to select the entire line, the Git compare window pops up and I've lost my spot, my train of thought, and my Zen calm. A "no, I really, really don't want the Git hair trigger selecter" option would be really nice.
cheers
Chris Maunder
|
|
|
|
|
Tell me about it. We used VS2008 as our primary development tool until a year or so ago. Stop gagging. We updated to VS2019, and it's taken serious research and time to turn off most of the silly gew-gaws and visual noise. With all of the tooltips and text fragments attached to your source code, you couldn't see the code itself.
The notion of updating to VS2022 does not excite me.
Software Zen: delete this;
|
|
|
|
|
As my bushie mate says to his dogs: Garn! Git outta here!
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
|
Yes!! Thank you.
I think the idea is sound. But the constant accidental triggering was driving me spare. There's an option to make it trigger on double-click which is perfect. It's there when you need it, not when you don't need it.
I would love it if they had right-click access to settings at the point you need it, not buried so deep. You told me where to find it and it still took some dedicated looking to actually spot it.
cheers
Chris Maunder
|
|
|
|
|
git gutter ? please tell us more.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|