Author Topic: /rant.  (Read 5554 times)

0 Members and 1 Guest are viewing this topic.

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4055
  • Country: gb
Re: /rant.
« Reply #75 on: April 09, 2023, 10:50:43 am »
I probably will go hybrid again.

I have done this in another project/component.  My WS2811 indicator LED code using a single timer for multiple purposes in a sequence.  When I tried to reconfigure the timer from a PWM w/ DMA to a basic output compare "time elpased" affair, HAL just fought me at every step. 

In the end I set up and each timers working with HAL.  Then "flattened" the hal code into a function, for each operation/config etc.  Then removed almost all the crap, leaving only a few breadcrumb for hal such as the structures and reused the call back pointers etc.

You are right.  My WS2811_Indicator_LL.c ended up only about 50 lines of code, including callbacks. 

What I don't like about it.  It's as brittle as glass.  I have moved it to 4 STM32 micro's now and each and every time it needs some reference manual digging to find out where they move, renamed or resized some register between them.  I suppose that IS why I split the LL file out.  Hopefully that will firm up in time and be easier to reuse.

I think there is a lot of low hanging fruit accessible by HAL, however, the green grass lawns of that basic stuff rapidly becomes a muddy slope upwards on a learning curve with HAL and the little mazes it presents which start to look like far more work than just reading the reference manual and doing it yourself!    The low hanging fruit is fine.  Grab it and run.  The next stuff up, slightly higher, only looks "slightly higher" it's not, you will spend days trying to climb that tree to get them.  Just go and get the long poles (the registers).
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf