pimoroni-pico icon indicating copy to clipboard operation
pimoroni-pico copied to clipboard

make fails with '__bswap32' error vl53l1x.cpp

Open ObligedTester opened this issue 2 years ago • 1 comments

Trying to build the pimoroni samples just to attempt to use the C examples to use the e-ink on the badger. However it fails while compiling:

vl53l1x.cpp: In member function 'uint32_t pimoroni::VL53L1X::readReg32Bit(uint16_t)': vl53l1x.cpp:220:12: error: '__bswap32' was not declared in this scope 220 | return __bswap32(value); | ^~~~~~~~~

Have no insight in how the pimoroni libraries are built and its quite large, so any inputs is appreciated.

ObligedTester avatar Mar 04 '23 11:03 ObligedTester

I think this needs replacing with __builtin_bswap32 in our codebase.

Looks like I missed this when doing https://github.com/pimoroni/pimoroni-pico/commit/21b4ff68d76f629eb772946fb273703cc037ee3c

In the meantime you can probably just edit that one file: https://github.com/pimoroni/pimoroni-pico/blob/94d5b0cd33a5b0d07e100904c5e5827c8efe5e3a/drivers/vl53l1x/vl53l1x.cpp#L220

And change it to __builtin_bswap32

Gadgetoid avatar Mar 10 '23 14:03 Gadgetoid