Liam Murphy
8a261b050c
Remove the multicore trampoline and make the core 1 startup function generic
...
I managed to avoid the multicore trampoline by messing with the signature of the core 1 startup function.
While the first couple arguments to a function with the arm C abi are passed in registers, once they're filled up, the rest of the arguments go on the stack; so, I put some dummy arguments before the real arguments to force them to go onto the stack. That allows it to be used directly, without needing the trampoline to move the arguments from the stack to registers.
I also changed the startup function to be generic over the function type passed, which avoids the mess of dealing with `Core1Main` and fat pointers and all that.
2022-04-20 19:30:32 +10:00
Liam Murphy
56aa96769d
Don't assume usize
is 32 bits
2022-03-05 21:57:35 +11:00
Liam Murphy
51cd52bb8c
fmt
2022-03-05 18:53:11 +11:00
Liam Murphy
f0b46c0f58
Remove the alloc requirement for Core::spawn
2022-03-05 14:55:32 +11:00
9names
a40bcc94ea
Add changes since 0.3.0 to changelog ( #295 )
2022-03-03 14:34:51 +11:00
9names
111654fc28
Merge pull request #291 from jannic/avoid-64bit-division
...
Avoid 64bit division
2022-02-27 10:42:56 +11:00
Jan Niehusmann
021e942e47
Fix clippy warnings
2022-02-27 09:29:54 +11:00
Jan Niehusmann
b46ddd7351
Add test cases for fractional_div()
2022-02-26 13:33:58 +00:00
Jan Niehusmann
fecde70cf9
Derive several traits for ClockError
2022-02-26 13:33:58 +00:00
Jan Niehusmann
402b7f1eb8
Use u32 instead of u64 division in clock calculations
...
This saves about 1kB of flash by removing
compiler_builtins::int::specialized_div_rem::u64_div_rem if
no other code uses u64 divisions.
2022-02-26 13:33:58 +00:00
Jan Niehusmann
7750781650
Implement embedded-hal 1.0.0-alpha.7 traits ( #298 )
...
* embedded-hal v1.0.0-alpha.7 removed several traits
* bump dependency to embedded-hal 1.0.0-alpha.7
* Mention embedded-hal alpha changes in changelog
2022-02-26 21:06:55 +11:00
Emil Fresk
b7e56d0869
Added so stopped PIO state machines can change their clock divider
2022-02-26 20:57:12 +11:00
Jonathan 'theJPster' Pallant
212ffec6ca
Merge pull request #294 from 9names/gpio_irq_example
...
Add GPIO interrupt example
2022-02-21 18:10:27 +00:00
9names
4075f81b2d
Merge pull request #272 from 9names/watchdog_fix
...
Set hw reset bits for watchdog
2022-02-20 16:46:12 +11:00
9names
8063882801
Add note about #[interrupt] mut -> &mut transform
...
Co-authored-by: Jan Niehusmann <github@gondor.com>
2022-02-16 22:48:52 +11:00
9names
35875c8756
Store pins together in a tuple to reduce boilerplate
2022-02-15 20:17:18 +11:00
9names
44a9b0f541
Add GPIO interrupt example
2022-02-14 22:47:46 +11:00
9names
fff980611a
Merge pull request #289 from astraw/fix-typo
...
fix typo
2022-02-13 13:37:12 +11:00
Derek Hageman
80c84b13ba
Add ROM floating point math library
...
Hook up the ROM functions to floating point intrinsics.
2022-02-12 11:56:24 -07:00
Derek Hageman
ce681b4f10
Move divider intrinsics to the new intrinsics macro
2022-02-12 11:56:24 -07:00
Derek Hageman
a70eb89799
Add basic ROM intrinsics
...
Add a standardized macro for intrinsics export and connect the simple
ROM functions to intrinsics.
2022-02-12 11:56:24 -07:00
Derek Hageman
81ab38fd71
Add ROM version check
...
Add a check for a V2 bootrom when using floating point functions that
require it. Panic when it's not present.
2022-02-06 17:14:27 -07:00
Andrew Straw
799449dd1a
fix typo
2022-02-06 09:03:30 +01:00
Derek Hageman
a6f2453440
Fix ROM function signatures
...
Fix a few function signatures that don't match the ROM according to the
datasheet.
_memset4 also has a wrong code in the datasheet, so match it to the
actual ROM.
2022-02-04 07:18:11 -07:00
Jonathan 'theJPster' Pallant
8bdecd2058
Merge pull request #283 from Sizurka/rom-functions
...
Improve ROM function access
2022-02-04 09:53:59 +00:00
Derek Hageman
98fd6c1724
Add ROM function caching
...
Add a feature to enable automatic caching of the result of ROM table
function lookups.
2022-02-03 13:45:18 -07:00
Derek Hageman
a6daaf9fa3
Standardize ROM function access
...
Make all ROM functions (normal and floating point) provide both a direct
call that does the operation and a module with a ptr() function to get
the function pointer.
2022-02-03 13:32:18 -07:00
Jonathan 'theJPster' Pallant
16c9064c52
Merge pull request #280 from 9names/alarm-ergonomics
...
Use atomic operations for altering Timer alarm interrupts
2022-02-03 19:47:40 +00:00
Jonathan 'theJPster' Pallant
385c92392b
Merge pull request #278 from Sizurka/divider-intrinsics
...
Implement intrinsics for the hardware divider
2022-02-03 19:46:00 +00:00
Andrew Straw
cd15d268f6
run 'cargo fmt'
2022-02-02 22:10:39 +01:00
Andrew Straw
a1ed9ef93c
example of side setting using PIO
2022-02-01 11:09:09 +01:00
Jonathan 'theJPster' Pallant
354a2a5e5e
Merge pull request #281 from rp-rs/update_pac
...
Use new spinlock API provide by PAC 0.3.0
2022-01-31 10:40:02 +00:00
Jonathan 'theJPster' Pallant
4a540d041a
Hide spinlock 31.
2022-01-30 16:43:59 +00:00
Jonathan 'theJPster' Pallant
efda22c9ea
Update spinlock docs.
2022-01-30 16:43:53 +00:00
Jonathan 'theJPster' Pallant
f44f5f0e09
Make clippy happy.
2022-01-30 16:12:43 +00:00
Jonathan 'theJPster' Pallant
35a10f2bc6
Clean up critical-section impl.
...
Adds new `Sio::core()` function.
2022-01-30 16:07:40 +00:00
Jonathan 'theJPster' Pallant
7e2f8d274c
Use const generics for spinlocks.
...
The fewer code-generating macros we have, the better!
2022-01-30 15:56:23 +00:00
Jonathan 'theJPster' Pallant
c8c366c23d
Use new spinlock API provide by PAC 0.3.0
2022-01-30 12:56:51 +00:00
9names
b19f2cc8e5
Use atomic operations for altering Timer interrupts
2022-01-30 22:54:27 +11:00
Jan Niehusmann
a9763837a9
Add comment regarding release mode
2022-01-28 22:18:32 +00:00
Jan Niehusmann
f6b2e3365e
use dht-sensor crate and fix comments
2022-01-28 21:36:30 +00:00
Jan Niehusmann
bb6b7706f9
Add dht11 example
2022-01-28 19:44:26 +00:00
Jonathan Pallant
5771f872f2
Merge pull request #269 from 9names/fix_uart_example_clock
...
Use .freq() to avoid moving clock
2022-01-28 15:03:23 +00:00
Wilfried Chauveau
d08bfac989
Fix i2c peripheral mode state machine
...
The start_det flag is set as soon as a start condition occurs
whereas rd_req flag is only set once the address byte is received.
2022-01-29 00:01:32 +11:00
Derek Hageman
f279945315
Add intrinsics for the hardware divider
...
Implement intrinsic functions so basic operators use the hardware divider.
2022-01-26 19:37:06 -07:00
Derek Hageman
35704d9799
Change divider delay to explicit NOPs
...
Use explicit NOPs since cortex_m::asm::delay actually delays for
longer than we need to.
2022-01-26 19:37:06 -07:00
Derek Hageman
c2d3b21d91
Make hardware divisor interrupt safe
...
Copy the pico-sdk logic for save and restore of the hardware divider
for making it interrupt safe.
2022-01-26 19:37:06 -07:00
9names
57e9943836
Set hw reset bits for watchdog
2022-01-20 21:55:16 +11:00
9names
c8b75204ee
Use .freq() to avoid moving clock
2022-01-20 18:28:51 +11:00
Victor Koenders
d6e3c7b615
Set the uart config default baud rate to 115200
2022-01-18 17:28:13 +01:00