mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-22 07:45:29 +03:00
Adding RP2350 SDK and target framework (#13988)
* Adding RP2350 SDK and target framework * Spacing * Removing board definitions
This commit is contained in:
parent
462cb05930
commit
2dd6f95aad
576 changed files with 435012 additions and 0 deletions
102
lib/main/pico-sdk/rp2_common/pico_lwip/include/arch/cc.h
Normal file
102
lib/main/pico-sdk/rp2_common/pico_lwip/include/arch/cc.h
Normal file
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef __CC_H__
|
||||
#define __CC_H__
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifndef PICO_LWIP_CUSTOM_LOCK_TCPIP_CORE
|
||||
#define PICO_LWIP_CUSTOM_LOCK_TCPIP_CORE 1
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if NO_SYS
|
||||
// todo really we should just not allow SYS_LIGHTWEIGHT_PROT for nosys mode (it doesn't do anything anyway)
|
||||
typedef int sys_prot_t;
|
||||
#elif PICO_LWIP_CUSTOM_LOCK_TCPIP_CORE
|
||||
void pico_lwip_custom_lock_tcpip_core(void);
|
||||
void pico_lwip_custom_unlock_tcpip_core(void);
|
||||
#define LOCK_TCPIP_CORE() pico_lwip_custom_lock_tcpip_core()
|
||||
#define UNLOCK_TCPIP_CORE() pico_lwip_custom_unlock_tcpip_core()
|
||||
#endif
|
||||
|
||||
/* define compiler specific symbols */
|
||||
#if defined (__ICCARM__)
|
||||
|
||||
#define PACK_STRUCT_BEGIN
|
||||
#define PACK_STRUCT_STRUCT
|
||||
#define PACK_STRUCT_END
|
||||
#define PACK_STRUCT_FIELD(x) x
|
||||
#define PACK_STRUCT_USE_INCLUDES
|
||||
|
||||
#elif defined (__CC_ARM)
|
||||
|
||||
#define PACK_STRUCT_BEGIN __packed
|
||||
#define PACK_STRUCT_STRUCT
|
||||
#define PACK_STRUCT_END
|
||||
#define PACK_STRUCT_FIELD(x) x
|
||||
|
||||
#elif defined (__GNUC__)
|
||||
|
||||
#define PACK_STRUCT_BEGIN
|
||||
#define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
|
||||
#define PACK_STRUCT_END
|
||||
#define PACK_STRUCT_FIELD(x) x
|
||||
|
||||
#elif defined (__TASKING__)
|
||||
|
||||
#define PACK_STRUCT_BEGIN
|
||||
#define PACK_STRUCT_STRUCT
|
||||
#define PACK_STRUCT_END
|
||||
#define PACK_STRUCT_FIELD(x) x
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef LWIP_PLATFORM_ASSERT
|
||||
#include "pico.h"
|
||||
#define LWIP_PLATFORM_ASSERT(x) panic(x)
|
||||
#endif
|
||||
|
||||
#ifndef LWIP_RAND
|
||||
#include "pico/rand.h"
|
||||
// Use the pico_rand library which goes to reasonable lengths to try to provide good entropy
|
||||
#define LWIP_RAND() get_rand_32()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CC_H__ */
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef _PICO_LWIP_FREERTOS_H
|
||||
#define _PICO_LWIP_FREERTOS_H
|
||||
|
||||
#include "pico.h"
|
||||
#include "pico/async_context.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** \file pico/lwip_freertos.h
|
||||
* \defgroup pico_lwip_freertos pico_lwip_freertos
|
||||
* \ingroup pico_lwip
|
||||
* \brief Glue library for integration lwIP in \c NO_SYS=0 mode with the SDK
|
||||
*
|
||||
* Simple \c init and \c deinit are all that is required to hook up lwIP (with full blocking API support) via an \ref async_context instance
|
||||
*/
|
||||
|
||||
/*! \brief Initializes lwIP (NO_SYS=0 mode) support support for FreeRTOS using the provided async_context
|
||||
* \ingroup pico_lwip_freertos
|
||||
*
|
||||
* If the initialization succeeds, \ref lwip_freertos_deinit() can be called to shutdown lwIP support
|
||||
*
|
||||
* \param context the async_context instance that provides the abstraction for handling asynchronous work. Note in general
|
||||
* this would be an \ref async_context_freertos instance, though it doesn't have to be.
|
||||
*
|
||||
* \return true if the initialization succeeded
|
||||
*/
|
||||
bool lwip_freertos_init(async_context_t *context);
|
||||
|
||||
/*! \brief De-initialize lwIP (NO_SYS=0 mode) support for FreeRTOS
|
||||
* \ingroup pico_lwip_freertos
|
||||
*
|
||||
* Note that since lwIP may only be initialized once, and doesn't itself provide a shutdown mechanism, lwIP
|
||||
* itself may still consume resources.
|
||||
*
|
||||
* It is however safe to call \ref lwip_freertos_init again later.
|
||||
*
|
||||
* \param context the async_context the lwip_freertos support was added to via \ref lwip_freertos_init
|
||||
*/
|
||||
void lwip_freertos_deinit(async_context_t *context);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef _PICO_LWIP_NOSYS_H
|
||||
#define _PICO_LWIP_NOSYS_H
|
||||
|
||||
#include "pico.h"
|
||||
#include "pico/async_context.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** \file pico/lwip_nosys.h
|
||||
* \defgroup pico_lwip_nosys pico_lwip_nosys
|
||||
* \ingroup pico_lwip
|
||||
* \brief Glue library for integration lwIP in \c NO_SYS=1 mode with the SDK
|
||||
*
|
||||
* Simple \c init and \c deinit are all that is required to hook up lwIP via an \ref async_context instance.
|
||||
*/
|
||||
|
||||
/*! \brief Initializes lwIP (NO_SYS=1 mode) support support using the provided async_context
|
||||
* \ingroup pico_lwip_nosys
|
||||
*
|
||||
* If the initialization succeeds, \ref lwip_nosys_deinit() can be called to shutdown lwIP support
|
||||
*
|
||||
* \param context the async_context instance that provides the abstraction for handling asynchronous work.
|
||||
* \return true if the initialization succeeded
|
||||
*/
|
||||
bool lwip_nosys_init(async_context_t *context);
|
||||
|
||||
/*! \brief De-initialize lwIP (NO_SYS=1 mode) support
|
||||
* \ingroup pico_lwip_nosys
|
||||
*
|
||||
* Note that since lwIP may only be initialized once, and doesn't itself provide a shutdown mechanism, lwIP
|
||||
* itself may still consume resources
|
||||
*
|
||||
* It is however safe to call \ref lwip_nosys_init again later.
|
||||
*
|
||||
* \param context the async_context the lwip_nosys support was added to via \ref lwip_nosys_init
|
||||
*/
|
||||
void lwip_nosys_deinit(async_context_t *context);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue