mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
Remove ARM assembly from RISC-V CYW43 SPI PIO (#2045)
Add hand-coded assembly RISC-V version of swap16x2 for CYW32 SPI PIO driver. Fixes #2044
This commit is contained in:
parent
1b64cac8d6
commit
0f847db371
1 changed files with 9 additions and 1 deletions
|
|
@ -80,7 +80,15 @@ static uint32_t counter = 0;
|
|||
|
||||
//#define SWAP32(A) ((((A) & 0xff000000U) >> 8) | (((A) & 0xff0000U) << 8) | (((A) & 0xff00U) >> 8) | (((A) & 0xffU) << 8))
|
||||
__force_inline static uint32_t __swap16x2(uint32_t a) {
|
||||
#ifndef __riscv
|
||||
pico_default_asm ("rev16 %0, %0" : "+l" (a) : : );
|
||||
#else
|
||||
uint32_t tmp;
|
||||
pico_default_asm (
|
||||
"rev8 %1, %0\n"
|
||||
"rori %0, %1, 16\n"
|
||||
: "+l" (a), "=l" (tmp));
|
||||
#endif
|
||||
return a;
|
||||
}
|
||||
#define SWAP32(a) __swap16x2(a)
|
||||
|
|
@ -596,4 +604,4 @@ uint cyw43_get_pin_wl(cyw43_pin_index_t pin_id) {
|
|||
assert(cyw43_pin_array[pin_id] < NUM_BANK0_GPIOS);
|
||||
return cyw43_pin_array[pin_id];
|
||||
}
|
||||
#endif // CYW43_PIN_WL_DYNAMIC
|
||||
#endif // CYW43_PIN_WL_DYNAMIC
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue