Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ARM assembly from RISC-V CYW43 SPI PIO #2045

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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