SDK 1.3.0 release
See release notes for details Co-authored-by: Brian Cooke <bdscooke@gmail.com> Co-authored-by: Luke Wren <wren6991@gmail.com> Co-authored-by: Uri Shaked <uri@urishaked.com> Co-authored-by: Zapta <zapta@users.noreply.github.com> Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com> Co-authored-by: Liam Fraser <liam@raspberrypi.com> Co-authored-by: Gabriel Wang <embedded_zhuoran@Hotmail.com> Co-authored-by: Matias Silva <matita.martins@gmail.com> Co-authored-by: dp111 <19616418+dp111@users.noreply.github.com> Co-authored-by: Leonardo La Rocca <46094699+leoli51@users.noreply.github.com> Co-authored-by: Mahyar Koshkouei <mk@deltabeard.com> Co-authored-by: Brian Starkey <stark3y@gmail.com> Co-authored-by: Philip Howard <github@gadgetoid.com> Co-authored-by: Mike Causer <mcauser@gmail.com> Co-authored-by: Martino Facchin <m.facchin@arduino.cc> Co-authored-by: ZodiusInfuser <christopher.parrott2@gmail.com> Co-authored-by: Manuel Wick <manuel@matronix.de> Co-authored-by: Matias Silva <git@matiasilva.com> Co-authored-by: Robert Pafford <19439938+rjp5th@users.noreply.github.com> Co-authored-by: Alasdair Allan <alasdair@raspberrypi.com> Co-authored-by: Engineer_Will <646689853@qq.com> Co-authored-by: Garatronic <31109090+garatronic@users.noreply.github.com>
This commit is contained in:
@ -20,16 +20,18 @@
|
||||
|
||||
#include "pico/mutex.h"
|
||||
#include "pico/time.h"
|
||||
|
||||
#if LIB_PICO_PRINTF_PICO
|
||||
#include "pico/printf.h"
|
||||
#else
|
||||
#define weak_raw_printf printf
|
||||
#define weak_raw_vprintf vprintf
|
||||
#endif
|
||||
|
||||
#if PICO_ENTER_USB_BOOT_ON_EXIT
|
||||
#include "pico/bootrom.h"
|
||||
#endif
|
||||
|
||||
#ifndef PICO_NO_RAM_VECTOR_TABLE
|
||||
#define PICO_NO_RAM_VECTOR_TABLE 0
|
||||
#endif
|
||||
|
||||
extern char __StackLimit; /* Set by linker. */
|
||||
|
||||
uint32_t __attribute__((section(".ram_vector_table"))) ram_vector_table[48];
|
||||
@ -113,15 +115,27 @@ void runtime_init(void) {
|
||||
hw_clear_alias(padsbank0_hw)->io[28] = hw_clear_alias(padsbank0_hw)->io[29] = PADS_BANK0_GPIO0_IE_BITS;
|
||||
#endif
|
||||
|
||||
extern mutex_t __mutex_array_start;
|
||||
extern mutex_t __mutex_array_end;
|
||||
// this is an array of either mutex_t or recursive_mutex_t (i.e. not necessarily the same size)
|
||||
// however each starts with a lock_core_t, and the spin_lock is initialized to address 1 for a recursive
|
||||
// spinlock and 0 for a regular one.
|
||||
|
||||
// the first function pointer, not the address of it.
|
||||
for (mutex_t *m = &__mutex_array_start; m < &__mutex_array_end; m++) {
|
||||
if (m->recursion_state) {
|
||||
recursive_mutex_init(m);
|
||||
static_assert(!(sizeof(mutex_t)&3), "");
|
||||
static_assert(!(sizeof(recursive_mutex_t)&3), "");
|
||||
static_assert(!offsetof(mutex_t, core), "");
|
||||
static_assert(!offsetof(recursive_mutex_t, core), "");
|
||||
extern lock_core_t __mutex_array_start;
|
||||
extern lock_core_t __mutex_array_end;
|
||||
|
||||
for (lock_core_t *l = &__mutex_array_start; l < &__mutex_array_end; ) {
|
||||
if (l->spin_lock) {
|
||||
assert(1 == (uintptr_t)l->spin_lock); // indicator for a recursive mutex
|
||||
recursive_mutex_t *rm = (recursive_mutex_t *)l;
|
||||
recursive_mutex_init(rm);
|
||||
l = &rm[1].core; // next
|
||||
} else {
|
||||
mutex_t *m = (mutex_t *)l;
|
||||
mutex_init(m);
|
||||
l = &m[1].core; // next
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,7 +244,7 @@ extern void __attribute__((noreturn)) __printflike(1, 0) PICO_PANIC_FUNCTION(__u
|
||||
// Use a forwarding method here as it is a little simpler than renaming the symbol as it is used from assembler
|
||||
void __attribute__((naked, noreturn)) __printflike(1, 0) panic(__unused const char *fmt, ...) {
|
||||
// if you get an undefined reference here, you didn't define your PICO_PANIC_FUNCTION!
|
||||
asm (
|
||||
__asm (
|
||||
"push {lr}\n"
|
||||
#if !PICO_PANIC_FUNCTION_EMPTY
|
||||
"bl " __XSTRING(PICO_PANIC_FUNCTION) "\n"
|
||||
|
Reference in New Issue
Block a user