Commit Graph

51 Commits

Author SHA1 Message Date
Stephen Robinson
b3cf3e8f6f
Correct comment in time.h (#715)
There was `microseconds` written where there should have been `milliseconds`.

Co-authored-by: Stephen <stephen@drsudo.com>
2022-01-22 19:57:47 -06:00
Thomas Fike
215f77b836
Moves the #if guards to before the comments (#690)
Fixes #683
2022-01-08 13:53:21 -06:00
Graham Sanderson
60c5a929cc
Remove <b> from mutex doxygen due to PDF generation bug 2021-11-01 14:16:20 -05:00
Graham Sanderson
e850214938
Platform updates (#611)
* Platform updates
 - Add PICO_RP2040=1 to rp2040 builds
 - Add new PICO_RP2040_B0/1/2_SUPPORTED macros and retailer chip specific code to use
 - Add doxygen to platform.h
 - Make pico.h includable from assembly (because header order is important and tricky) - split out platform_asm.h
 - Switch to using PICO_RP2040_B0_SUPPORTED in board headers
2021-10-25 12:26:06 -05:00
Graham Sanderson
05418b4e71
fix minor bug in add_repeating_timer_us, and add some comments (#621) 2021-10-25 09:32:02 -05:00
Graham Sanderson
3c72e753b6
Split recursive mutex into their own functions (was Reduce performance hit of recursive mutex) (#495)
mutex_t and mutex_ are reverted to non recursive versions (pre SDK1.2.0) and new recursive_mutex_t and recursive_mutex_ functions have been added

PICO_MUTEX_ENABLE_SDK120_COMPATIBILITY flag has been added to allow old SDK1.2.0 compatibility (i.e. mutex_t can be used recursively or not) but this is slower (and is will be removed in a future version)
2021-10-20 18:27:59 -05:00
Graham Sanderson
13ed99df0d
split out usb_reset_interface header into its own library for consumption by picotool or others (#589) 2021-10-07 08:17:13 -05:00
Graham Sanderson
0fdf543126
Missing extern C in datetime.h #581 (#584) 2021-10-04 15:17:00 -05:00
Brian Starkey
1d0dcc8177
pico_time: Fix alarm_pool_dump_key format string (#557)
Add requred "%" before PRIu64.

pico-sdk/src/common/pico_time/time.c:282:20: warning: data argument not used by format string [-Wformat-extra-args]
2021-10-04 13:09:59 -05:00
graham sanderson
45a1e08265 fix sem_acquire_block_until function name 2021-06-03 10:36:48 -05:00
Graham Sanderson
5afa3636d6
Small API additions and minor fixes (#406)
* Add missing DREQ_s

* store actual clock frequency in clock_configure (fixes #368)

* use dma DREQ values defined in dreqs/dma.h

* Fix hw_is_claimed, and add xxx_is_claimed APIs

* Add some PIO irq helper methods

* Add DMA channel IRQ status getter and clear methods

* Implement the correct PIO IRQ status/clear methods (good to have methods here as the h/w interrupt registers are super confusing)

* fix pico_multicore dependencies

* add missing wrapper func __aeabi_f2d

* Further DMA/PIO IRQ API cleanup (and review fixes)

* add PICO_INT64_OPS_IN_RAM flag
2021-06-02 13:12:27 -05:00
Jonathan Reichelt Gjertsen
b8dc054eba
queue: make data pointers const in queue_try_add and queue_add_blocking (#423)
The only operation done on the data pointer is to pass it into the second
argument of memcpy, which is `const void *`
2021-05-24 16:52:49 -05:00
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
Graham Sanderson
c6c4eeb122
add timeout_us/until to mutex/sem blocking methods (#402) 2021-05-12 16:32:45 -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
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
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
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
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
fe3408b286
Small fixes (#260)
* pico_stdio_usb: be more explicit about includes, fix warning (#257)

* pico_base: NDEBUG backwards for absolute_time_t (#255)

* pico_util: missing extern C in queue.h (#249)

* build: remove -march which was masking -mcpu, now SVC available (#253)
2021-03-17 18:05:48 +00:00
Andrew Scheller
1413a4f470 Fixup PICO_CONFIG entries (#208)
* remove default=undefined
 * fix a couple of typos / syntax "errors"
 * perform even better default-value-checking in extract_configs.py
2021-03-04 21:22:48 -06:00
Andrew Scheller
fc17f880fd Lots of Doxygen tweaks and fixes (#212)
* Add documentation for gpio_irq_callback_t and rtc_callback_t (fixes #175)
 * Hook up pico_binary_info and pico_bootsel_via_double_reset to the Doxygen index
 * Add link to new Raspberry Pi Pico FAQ
 * Consistently add parentheses for \sa or \see links to function-names
 * Use consistent capitalisation for 'GitHub'
 * Small typos and markup errors
2021-03-04 21:22:48 -06:00
Graham Sanderson
7ee36e3328 Rationalize board header pin defines, and add partner board headers (#192)
* Board definition header files for the iniital set of SparkFun rp2040 boards

* Add default PICO_DEFAULT_I2C*, allow no PICO_DEFAULT_LED_PIN, no PICO_DEFAULT_UART* (instead of -1)
Fixup SparkFun headers

* Pimoroni board headers

* Add LED related board defines PICO_CONFIGs (to pico_stdlib for now)

* more board config changes

* add Adafruit feather, itsybitsy, qtpy board headers

* add PICO_DEFAULT_WS2812_POWER_PIN define

* MOSI/MISO -> TX/RX, some UART cleanup.. make vgaboard.h defines take preference over pico.h ones

* local change to tinyusb to cope with no default LED or UART

* fix review issues

Co-authored-by: Kirk Benell <github-stuff@accvec.com>
Co-authored-by: ZodiusInfuser <christopher.parrott2@gmail.com>
Co-authored-by: hathach <thach@tinyusb.org>
2021-03-04 21:22:48 -06:00
graham sanderson
383e88ea16 Add support for resetting RP2040 via the USB connection when using pico_stdio_usb
- setting baud rate to magic value (default=1200) will cause a reset to BOOTSEL mode
	- a VENDOR interface along side the CDC interface can be used to reset via refular flash boot, or into
	  BOOTSEL mode with control for the reset_usb_boot parameters for the latter
either method can be configured/enabled/disabled via #define
2021-03-04 21:22:48 -06:00
graham sanderson
e371f6af60 remove useless PICO_ALLOW_SLEED_IN_EXCEPTION 2021-03-04 21:22:48 -06:00
graham sanderson
aca685ceae panic in debug mode if sleep methods are called in an exception handler (unless PICO_ALLOW_SLEEP_IN_EXCEPTION is set) 2021-03-04 21:22:48 -06:00
Andrew Scheller
e5d61f1ad3 Add some "\ingroup timestamp" doxy-comments so that they actually appear in the output! 2021-03-04 21:22:48 -06:00
graham sanderson
7ed5d87fb1 host mode fixups 2021-03-04 21:22:48 -06:00
Andrew Scheller
4335268a93 Default PARAM_ASSERTIONS_ENABLED_LOCK_CORE to 0 (#184)
so that it matches all the other PARAM_ASSERTIONS_* default values
2021-03-04 21:22:48 -06:00
Graham Sanderson
e730e03e7f No malloc for default alarm pool an pheap docs/cleanup (#143)
* Statically allocate the default timer pool (to avoid pulling in malloc); doxygen for pheap (and some function name changes)

* fix comments
2021-03-04 21:22:48 -06:00
graham sanderson
0a22f704a6 re-arrange pico/types.h to avoid duplicate doxygen 2021-03-04 21:22:48 -06:00
graham sanderson
228de60da0 fix comment 2021-03-04 21:22:48 -06:00
graham sanderson
684986aae6 fix the represntation of at_the_end_of_time to be 63 one bits rather than 32 2021-03-04 21:22:48 -06:00
graham sanderson
503bc8b385 Fixup another level of compiler warnings, add _U() definition 2021-03-04 21:22:48 -06:00
Graham Sanderson
b53b0bac70 Bunch of small fixes (#154)
* use valid_params_if macro for lock assertion

* fixup param checking in pwm.h

* Fix range of fractional divider parameter check in pwm.h

Co-authored-by: Luke Wren <wren6991@gmail.com>
2021-03-04 21:22:48 -06:00
graham sanderson
4b7ffd71f0 add boot2 info to binary info 2021-03-04 21:22:48 -06:00
graham sanderson
dee8bd992c remove always true assertions (fix #83) 2021-03-04 21:22:48 -06:00
Graham Sanderson
6f94f6a3d7 Add -Wuninitialized -Wunused -Wcast-align to warnings checked by kitchen_sink (and fixup warnings) (#125) 2021-03-04 21:22:48 -06:00
Brian Swetland
a362925eda Clean up various C source and headers to appease -Wstrict-prototypes
In C, func() is a function taking an unspecified number of arguments,
vs func(void) a function taking no arguments. In C++ both forms indicate
"no arguments."

Update these headers to use the (void) form, which is correct in both
languages and avoids complaints when -Wstrict-prototypes is specified.
2021-03-04 21:22:47 -06:00
graham sanderson
f73611c322 remove added unused error code 2021-02-01 14:46:45 -06:00
graham sanderson
a98136628c uart_set_baudrate should return actual rate set even in case of out of range parameters 2021-02-01 14:46:45 -06:00
graham sanderson
4cc1efa01a fixup debug build 2021-02-01 14:46:45 -06:00
graham sanderson
3e52e57f5f Standardise references to the Raspberry Pi Pico SDK 2021-02-01 14:46:45 -06:00
graham sanderson
90ce1faa14 Mutex owned and owner were not initialized by mutex_init. Combined owned and owner as they had no separate value any more 2021-02-01 14:46:45 -06:00
graham sanderson
8dd84ad0d8 pico_time comment changes: remove stale comment, include warning about integer overflow 2021-02-01 14:46:45 -06:00
Graham Sanderson
e0b9d0ecd8 remove debugging left in by mistake (#31) 2021-02-01 14:46:45 -06:00