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

Use building on Mac M1 - code error #59

Open
2e0wkw opened this issue Mar 5, 2025 · 2 comments
Open

Use building on Mac M1 - code error #59

2e0wkw opened this issue Mar 5, 2025 · 2 comments

Comments

@2e0wkw
Copy link

2e0wkw commented Mar 5, 2025

Hi, I am compiling the code on a Mac Mini M1 and i get the following errors

[ 30%] Building C object CMakeFiles/pico-WSPRer.dir/WSPRbeacon/WSPRbeacon.c.o
/Users/eric/pico-WSPRer/WSPRbeacon/WSPRbeacon.c: In function 'WSPRbeaconTxScheduler':
/Users/eric/pico-WSPRer/WSPRbeacon/WSPRbeacon.c:322:48: error: passing argument 1 of 'sleep_goto_sleep_until' from incompatible pointer type [-Wincompatible-pointer-types]
322 | sleep_goto_sleep_until(&alarm_time, &sleep_callback); //blocks here during sleep perfiod
| ^~~~~~~~~~~
| |
| datetime_t *
In file included from /Users/eric/pico-WSPRer/WSPRbeacon/WSPRbeacon.c:12:
/Users/eric/pico-extras/src/rp2_common/pico_sleep/include/pico/sleep.h:77:46: note: expected 'struct timespec *' but argument is of type 'datetime_t *'
77 | void sleep_goto_sleep_until(struct timespec *ts, aon_timer_alarm_handler_t callback);
| ~~~~~~~~~~~~~~~~~^~
make[2]: *** [CMakeFiles/pico-WSPRer.dir/WSPRbeacon/WSPRbeacon.c.o] Error 1
make[1]: *** [CMakeFiles/pico-WSPRer.dir/all] Error 2
make: *** [all] Error 2

Can you advise please.

@EngineerGuy314
Copy link
Owner

I don't think the problem has anything to do with using a Mac. Looking through your error, it seems that Raspberry Pi made a change to the pico-extras repo (changed datetime_t to timespec). Everyone always says how great it is to "leverage shared open-source components". And it is, until they make a tiny change and screw you over.

An immediate but annoying solution is to checkout an older version of the pico-extras. It seems the offending change to the pico_sleep function was made on Nob 8, 2024 by peterharperuk.

Or I can figure out how to change my program to work with the new structure, but that will screw over anyone that is currently able to compile it, until they update their pico-extras to the current one.

3rd, I might be able to remove all references to pico_sleep from my program and sidestep the whole issue. (pico_sleep was used for a low-power battery mode, which doesn't work anymore anyway because of other changes I had to make to the PLL oscillator stuff).

I will push an update to the repo today that removes the pico_sleep references. Please let me know if it compiles for you. Thank you.

@EngineerGuy314
Copy link
Owner

interesting, I updated pico-extras on my system, and I now get warnings related to the datetime_t/timespec issue, but they are only warnings, not errors.

I guess something about gcc on a Mac is more strict than on PC?

Regardless, I just pushed an update to the repo with all the sleep stuff removed (since it wasn't working anyway).

Please let me know if you can now compile it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants