Commit Graph

453 Commits

Author SHA1 Message Date
Jonathan Reichelt Gjertsen
b2832b3acb
Fix wrong format string in alarm_pool_dump_key (#437)
Fixes the following warning when building for host

```
[...]/pico-sdk/src/common/pico_time/time.c: In function 'alarm_pool_dump_key':
[...]/pico-sdk/src/common/pico_time/time.c:282:15: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=]
     printf("%ld", to_us_since_boot(get_entry(pool, id)->target));
             ~~^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             %I64d
```
2021-05-24 16:32:31 -05:00
Jonathan Reichelt Gjertsen
060123dc8d
Optional feature to get the max level that has ever been held by a queue (#444)
I'm using this in my program to get a better idea of how many entries I
need to allocate to avoid blocking or losing data, and to debug performance
issues.
2021-05-24 16:31:30 -05:00
Jonathan Reichelt Gjertsen
596d08ea62
Add missing cast to uint32_t in hw_divider_u32_quotient for host (#436)
Fixes the following warning:

```
[...]/pico-sdk/src/host/hardware_divider/include/hardware/divider.h:81:26: warning: operand of ?: changes signedness from 'int' to 'uint32_t' {aka 'unsigned int'} due to unsignedness of other operand [-Wsign-compare]
     return b ? (a / b) : -1;
                          ^~
```
2021-05-23 08:21:09 -05:00
Rafael G. Martins
a32d614b43
pioasm: prevent double inclusion for C SDK generated headers (#417) 2021-05-18 18:05:35 -05:00
Joni Kähärä
5384b6b4d3 add comment about using clk_gpout0 enable bit (Fixes #413) 2021-05-17 09:12:41 +01:00
Graham Sanderson
607b42006a
fix pico_promote_common_scope_vars (#397) 2021-05-13 07:39:04 -05:00
Graham Sanderson
574fdee37b
Fixup divider save_restore for floating point too; improve tests (#405)
- The divider state needs to be saved for __aeabi_ddiv, __aeabi_fdiv, __aeabi_dtan and __aeabi_ftan or they won't work in interrupts *(probably not used much youd hope), or on an RTOS context switch
 - Refactored code out for the integer and floating point cases
 - Improved the floating point 'tests' in passing to check more return values against GCC implementations
 - Added floating point usage to the IRQ nesting test case
2021-05-13 07:38:42 -05:00
Graham Sanderson
c6c4eeb122
add timeout_us/until to mutex/sem blocking methods (#402) 2021-05-12 16:32:45 -05:00
Andrew Scheller
54c78bf985
Fix the PICO_CONFIG default value for PICO_CMSIS_RENAME_EXCEPTIONS (#399) 2021-05-11 19:21:44 -05:00
Graham Sanderson
b05d863428
Add basic CMSIS core headers (#384)
Adds a new cmsis_core INTERFACE library, which provides the basic CMSIS macros/definitions, and RP2040.h and system_RP2040.h
By default the isr_ methods in the vector table are renamed to their CMSIS versions, but this can be overridden by defining PICO_CMSIS_RENAME_EXCEPTIONS=0
2021-05-11 10:47:13 -05:00
Graham Sanderson
6182a2a078
make host pico_platform.h and binary_info.h CMakeLists.txt safe for inclusion in non SDK build (#388)
* make host pico_platform.h and binary_info.h CMakeLists.txt safe for inclusion in non SDK build

* fix comment
2021-05-11 10:37:49 -05:00
Graham Sanderson
508828f8ea
allow setting exception handler to the same value, as this might happen if exceptions are set dynamically on both cores, but VTOR is the same... this should indeed cause an error if the values differ, but not otherwise (#385) 2021-05-11 10:34:41 -05:00
Graham Sanderson
36dda1c5c4
Fix some hardware_library dependencies (#383) 2021-05-11 10:34:11 -05:00
Graham Sanderson
e57b99a652
Rework ordering of cmake, so that libraries in subdirectories can add to internal lists as PICO_SDK_POST_LIST_FILES, PICO_CONFIG_HEADER_FILES etc. (#382)
Move generation of config header later, so it gets to include all values for PICO_CONFIG_HEADER_FILES
2021-05-11 10:33:34 -05:00
Andrew Scheller
9396b9c7e1
Fix a bunch of doxygen typos (#391) 2021-05-10 08:48:09 -05:00
Andrew Scheller
ecf66bf514
Correct doxygen for mutex_try_enter (#392) 2021-05-10 08:47:23 -05:00
Andrew Scheller
114dc5a80d
Fixup IRQ_PRIORITY #define values (#393)
Related to #245
2021-05-10 08:46:53 -05:00
Graham Sanderson
8d4f4e148d
remove spurious sys/select.h include (#377) 2021-05-05 11:51:18 -05:00
Graham Sanderson
6d87da4c59
Rework lock_core / timers (#378)
- Add recursive_mutex
  - Make all locking primitives and sleep use common overridable wait/notify support to allow RTOS
    implementations to replace WFE/SEV with something more appropriate
  - Add busy_wait_ms
2021-05-05 11:46:25 -05:00
Graham Sanderson
ec0dc7a88b
add __always_inline to trivial super low level inline functions (#379) 2021-05-05 11:46:07 -05:00
Graham Sanderson
53f1915a6b
Add hardware_exception for setting exception handlers at runtime (#380) 2021-05-05 11:45:39 -05:00
Luke Wren
7fc75d8c90
Definitions for IC_TX_BUFFER_DEPTH inconsistent (fixes #335) (#381) 2021-05-05 11:45:12 -05:00
fivdi
8f3c3ff12a i2c: improve communication with i2c devices in i2c_write_blocking 2021-05-05 14:46:09 +01:00
Graham Sanderson
18c39856bd
Some cmake build improvements (#376)
* Change some cmake output to DEBUG level
Make SDK build more consistent with other libraries (use an INTERFACE marker library for inclusion tests)
Add PICO_SDK_PRE_LIST_FILES, PICO_SDK_POST_LIST_FILES build vars

* fix typo

* remove leftover debugging message
2021-05-04 08:40:11 -05:00
Graham Sanderson
929ede7482
add small delay to stdio_get_until to prevent starvation of USB IRQ handler due to in use mutex. build was non deterministic due to missing link wrapping of getchar (#364) 2021-05-04 08:01:34 -05:00
Graham Sanderson
b6f812f647
Change various (confusing to user) message to be DEBUG only (#365) 2021-05-04 08:01:11 -05:00
Graham Sanderson
b7da70a53b
make all non hardware_ libraries foo add C preprocessor definition LIB_FOO=1, and remove bespoke definitions which were all undocumented anyway (#374) 2021-05-04 08:00:17 -05:00
Graham Sanderson
6796faf0d5
add PICO_DIVIDER_DISABLE_INTERRUPTS flag which makes PICO_DIVIDER disable interrupts around division rather than using co-operative guards to protect nested use (i.e. within IRQ/exception). Use of this flag can simplify porting of RTOSes but with a different performance profile (#372) 2021-05-04 07:48:07 -05:00
Graham Sanderson
c979ca591f
disable core 0 SIO FIFO IRQ handler during core 1 launch in case someone has already installed one (#375) 2021-05-04 07:43:25 -05:00
Exr0n
d35d1b331e
Fix path + typo in README.md (#347)
* Fix path + typo in README.md

* Remove incorrect path change

* Remove typo
2021-05-02 15:14:17 -05:00
Graham Sanderson
4c83c10f01
make spi_init return baud rate set (#296) 2021-05-01 14:34:28 -05:00
Andrew Scheller
5259693774
Small typos (#366) 2021-05-01 14:32:16 -05:00
Ha Thach
6c4d25b887
correct adafruit flash size for itsybitsy and qt rp2040 (#348)
from 4 MB to 8 MB
2021-04-21 08:26:57 -05:00
Andrew Scheller
b17fc76c8f
Clarify multicore_fifo doxygen (#323)
Based on my observations in #284
2021-04-18 17:10:24 -05:00
Kirk Benell
b8dbbcf0d7
SPI Definitions for SparkFun boards (#344)
* SPI Definitions for SparkFun boards

Added the #defines for the default SPI pins on SparkFun boards

* SPI Definitions for SparkFun boards

Added the #defines for the default SPI pins on SparkFun boards

Co-authored-by: Kirk <blowme@cow.com>
2021-04-18 17:07:35 -05:00
ZodiusInfuser
93d3cf4d8e
Updated existing Pimoroni board headers to match latest style, and added a new board (#343)
* Updated existing pimoroni board headers to newer style from pico.h

* Added new pimoroni board headers

* Fixed incorrect MB and missing _pin

* Removed SPI defaults from Picosystem
2021-04-18 16:13:47 -05:00
Andrew Scheller
c6d70d51f4
Source code licence clarification (#340) 2021-04-15 15:35:06 -05:00
Michael Stoops
127543a425
Fixing arithmetic underflow in SPI I/O loops https://github.com/raspberrypi/pico-sdk/issues/337 (#338)
Co-authored-by: Michael Stoops <spam@michaelstoops.com>
2021-04-13 23:06:14 +01:00
Andrew Scheller
9c3538e8b0
Remove MASTER_ON_HOLD bit from I2C status registers. Fix typos. (#326) 2021-04-12 11:15:50 +01:00
Andrew Scheller
ec16d3ff28
Fix param-validation for PIO sideset encoding (#311) 2021-04-12 11:13:22 +01:00
Luke Wren
5fdc663ff8
Fix implementation config listing in structs/i2c.h (#325) 2021-04-09 14:42:06 +01:00
Luke Wren
962da33ea7
Clarify that cache is flushed, but that function is intended for low-level metadata access during startup (#322) 2021-04-09 08:05:29 -05:00
Luke Wren
344b961ebf
Fix implementation config listing in structs/i2c.h (#324) 2021-04-09 08:03:19 -05:00
Scott Shawcroft
814d2bd855
Make flash_do_cmd public (#269)
* Make flash_do_cmd public

* Fix typo in comment
2021-04-09 11:47:16 +01:00
Brian Cooke
f69f513a29
i2c: set high and low times to values that conform to the i2c specification (#314) 2021-04-09 11:00:33 +01:00
Andrew Scheller
4fe995d0ec
Update NULL GPIO function to 0x1f (#320)
Fixes #210
2021-04-08 15:25:01 -05:00
graham sanderson
aabae62caa Merge branch 'master' into develop 2021-04-07 08:29:59 -05:00
graham sanderson
afc10f3599 1.1.2 release 2021-04-07 08:17:18 -05:00
Graham Sanderson
92f948c123
Make kitchen_sink check param assertions, and include all headers - fix sign-compare warnings (#316) 2021-04-06 20:50:26 -05:00
Lyle Cheatham
0911393fe2
Changed the parameter check to avoid tripping -Werror on spin locks (#307)
This prevents a comparison between a signed and an unsigned number which
will create a warning tripping -Werror.

Also added a check for the alignment of the spin lock structure
2021-04-06 16:41:57 -05:00