bertvoldenuit opened a new pull request, #11212:
URL: https://github.com/apache/nuttx/pull/11212

   ## Summary
   ### In sam_dmac.c
   SAM_DMAC was not compiling out of the box and I found one inconsistency:
   
   - aligned keyword is changed to aligned_data. 
   - When setting the register CHINTENCLR in order to `Disable all channel 
interrupts`:
   
   |0x4C    |CHINTENSET | 7:0    |        |        |        |        |        
|SUSP    |TCMPL   |TERR    |
   
|--------|-----------|--------|--------|--------|--------|--------|--------|--------|--------|--------|
   |0x4D    |CHINTENSET | 7:0    |        |        |        |        |        
|SUSP    |TCMPL   |TERR    |
   
   Before:
   ```c
   putreg8(1 << chndx, SAM_DMAC_CHINTENCLR);
   ```
   
   if the number of channel (chndx) is above 3, it will do nothing, and above 7 
it will set the next register  CHINTENSET with potential misbehavior.
   I suppose the intent was to set the resister to 0000111 -> 0x07 or the 
existing DMAC_INT_ALL constant in sam_dmac.h
   
   After:
   ```c
   putreg8(DMAC_INT_ALL, SAM_DMAC_CHINTENCLR);
   ```
   ### In sam_dmac.h
   
   `#include "hardware/sam_dmac.h"` is removed because it does not exist.
   
   ## Impact
   
   This code now compiles.
   
   ## Testing
   The code runs. 
   In the context of using ws2812 driver, DMAC is interrupted after 2 beats 
because of Rx channel. I **still** get the error message in console: `Failed to 
allocate descriptor`. 
   
   I am still investigating.
   I did not test with a real spi peripheral yet.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to