Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Open Source > Industrial > Hardware &&
Donate
Please sign in before you donate.
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
9 Star 166 Fork 18

GVP RTduino/RTduino

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (2)
Tags (3)
master
spi-fix
v1.0.0
v0.1.1
v0.1.0
master
Branches (2)
Tags (3)
master
spi-fix
v1.0.0
v0.1.1
v0.1.0
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (2)
Tags (3)
master
spi-fix
v1.0.0
v0.1.1
v0.1.0
RTduino
/
core
/
RTduino.h
RTduino
/
core
/
RTduino.h
RTduino.h 7.00 KB
Copy Edit Raw Blame History
满鉴霆 authored 2024年03月18日 08:15 +08:00 . remove rt-thread version limit
/**
* @file RTduino.h
* @brief RTduino Core Header File.
* @author Meco Man
* @date 2022年09月27日
* @version 1.0
*
* @details
* This file is part of the RTduino project.
*
* The `RTduino.h` file serves as a pivotal component in the integration of the RT-Thread Real-Time Operating System (RTOS)
* into Arduino sketches. It extends the core functionality provided by the `Arduino.h` file by introducing structures,
* functions, and macros essential for creating and managing real-time tasks with specified stack sizes and priorities.
*
* This file builds upon the features of the `Arduino.h` file, enhancing development by introducing RT-Thread RTOS capabilities.
* This integration allows for efficient multitasking and real-time task execution in Arduino sketches. Notably, `RTduino.h` includes
* macros for creating RTduino loaders, critical components for effectively managing real-time tasks in Arduino programming.
*
* @copyright
* Copyright (c) 2021-2023, RTduino Development Team. All rights reserved.
*
* @note
* SPDX-License-Identifier: Apache-2.0
*
* @see
* - GitHub: https://github.com/RTduino/RTduino
* - Gitee: https://gitee.com/rtduino/RTduino
*/
#ifndef __RTDUINO_CORE__
#define __RTDUINO_CORE__
#include "Arduino.h"
#ifndef RTDUINO_THREAD_SIZE
#define RTDUINO_THREAD_SIZE 2048
#endif /* RTDUINO_THREAD_SIZE */
#ifndef RTDUINO_THREAD_PRIO
#define RTDUINO_THREAD_PRIO (RT_THREAD_PRIORITY_MAX - 2)
#endif /* RTDUINO_THREAD_PRIO */
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup MultiThread
* @brief Multi-threading support.
*/
/**
* @struct rtduino_loader_t
* @brief RTduino loader.
*/
typedef struct
{
const char* name; /**< Name of the loader. */
void (*setup)(void); /**< Setup function. */
void (*loop)(void); /**< Loop function. */
rt_thread_t thread; /**< Loader thread entity. */
} rtduino_loader, *rtduino_loader_t;
/**
* @ingroup MultiThread
* @brief Deletes an RTduino loader.
*
* @param loader Pointer to the RTduino loader to be deleted.
* @return RT_EOK on success, negative value on failure.
*/
rt_err_t rtduino_sketch_loader_delete(rtduino_loader_t loader);
/**
* @ingroup MultiThread
* @brief Creates an RTduino loader with specified stack size and priority.
*
* @param name Name of the loader.
* @param setup Setup function.
* @param loop Loop function.
* @param stack_size Stack size of the loader thread.
* @param priority Priority of the loader thread.
* @return Pointer to the created RTduino loader, or RT_NULL if the creation failed.
*/
rtduino_loader_t rtduino_sketch_loader_create_stacksize_prio(const char* name,
void (*setup)(void), void (*loop)(void), rt_uint32_t stack_size, rt_uint8_t priority);
/**
* @ingroup MultiThread
* @brief Creates an RTduino loader with default stack size and priority.
*
* @param name Name of the loader.
* @param setup Setup function.
* @param loop Loop function.
* @return Pointer to the created RTduino loader.
*/
rt_inline rtduino_loader_t rtduino_sketch_loader_create(const char* name,
void (*setup)(void), void (*loop)(void))
{
return rtduino_sketch_loader_create_stacksize_prio(name, setup, loop, RTDUINO_THREAD_SIZE, RTDUINO_THREAD_PRIO);
}
/**
* @ingroup MultiThread
* @brief Creates an RTduino loader with specified priority.
*
* @param name Name of the loader.
* @param setup Setup function.
* @param loop Loop function.
* @param priority Priority of the loader thread.
* @return Pointer to the created RTduino loader.
*/
rt_inline rtduino_loader_t rtduino_sketch_loader_create_prio(const char* name,
void (*setup)(void), void (*loop)(void), rt_uint8_t priority)
{
return rtduino_sketch_loader_create_stacksize_prio(name, setup, loop, RTDUINO_THREAD_SIZE, priority);
}
/**
* @ingroup MultiThread
* @brief Creates an RTduino loader with specified stack size.
*
* @param name Name of the loader.
* @param setup Setup function.
* @param loop Loop function.
* @param stack_size Stack size of the loader thread.
* @return Pointer to the created RTduino loader.
*/
rt_inline rtduino_loader_t rtduino_sketch_loader_create_stacksize(const char* name,
void (*setup)(void), void (*loop)(void), rt_uint32_t stack_size)
{
return rtduino_sketch_loader_create_stacksize_prio(name, setup, loop, stack_size, RTDUINO_THREAD_PRIO);
}
/**
* @ingroup MultiThread
* @brief Macro to define an RTduino loader with specified stack size, priority, and initialization level.
*
* @param name Name of the loader.
* @param setup Setup function.
* @param loop Loop function.
* @param stack_size Stack size of the loader thread.
* @param priority Priority of the loader thread.
* @param init_level Initialization level macro.
*/
#define RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO_INITLEVEL(name, setup, loop, stack_size, priority, init_level) \
static int _sketch_loader(void) \
{ \
rtduino_sketch_loader_create_stacksize_prio(name, setup, loop, stack_size, priority);\
return 0; \
} \
init_level(_sketch_loader)
/**
* @ingroup MultiThread
* @brief Macro to define an RTduino loader with specified stack size and priority.
*
* @param name Name of the loader.
* @param setup Setup function.
* @param loop Loop function.
* @param stack_size Stack size of the loader thread.
* @param priority Priority of the loader thread.
*/
#define RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO(name, setup, loop, stack_size, priority) \
RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO_INITLEVEL(name, setup, loop, stack_size, priority, INIT_APP_EXPORT)
/**
* @ingroup MultiThread
* @brief Macro to define an RTduino loader with default stack size and priority.
*
* @param name Name of the loader.
* @param setup Setup function.
* @param loop Loop function.
*/
#define RTDUINO_SKETCH_LOADER(name, setup, loop) \
RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO(name, setup, loop, RTDUINO_THREAD_SIZE, RTDUINO_THREAD_PRIO)
/**
* @ingroup MultiThread
* @brief Macro to define an RTduino loader with specified priority.
*
* @param name Name of the loader.
* @param setup Setup function.
* @param loop Loop function.
* @param priority Priority of the loader thread.
*/
#define RTDUINO_SKETCH_LOADER_PRIO(name, setup, loop, priority) \
RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO(name, setup, loop, RTDUINO_THREAD_SIZE, priority)
/**
* @ingroup MultiThread
* @brief Macro to define an RTduino loader with specified stack size.
*
* @param name Name of the loader.
* @param setup Setup function.
* @param loop Loop function.
* @param stack_size Stack size of the loader thread.
*/
#define RTDUINO_SKETCH_LOADER_STACKSIZE(name, setup, loop, stack_size) \
RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO(name, setup, loop, stack_size, RTDUINO_THREAD_PRIO)
#ifdef __cplusplus
} /* extern "C" { */
#endif
#endif /* __RTDUINO_CORE__ */
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

RT-Thread的Arduino生态兼容层
Cancel

Releases (1)

All

The Open Source Evaluation Index is derived from the OSS Compass evaluation system, which evaluates projects around the following three dimensions

1. Open source ecosystem

  • Productivity: To evaluate the ability of open-source projects to output software artifacts and open-source value.
  • Innovation: Used to evaluate the degree of diversity of open source software and its ecosystem.
  • Robustness: Used to evaluate the ability of open-source projects to resist internal and external interference and self recover in the face of changing development environments.

2. Collaboration, People, Software

  • Collaboration: represents the degree and depth of collaboration in open source development behavior.
  • Observe the influence of core personnel in open source projects, and examine the evaluations of users and developers on open source projects from a third-party perspective.
  • Software: Evaluate the value of products exported from open-source projects and their ultimate destination. It is also a concrete manifestation of "open source software", one of the oldest mainstream directions in open source evaluation.

3. Evaluation model

    Based on the dimensions of "open source ecosystem" and "collaboration, people, and software", identify quantifiable indicators directly or indirectly related to this goal, quantitatively evaluate the health and ecology of open source projects, and ultimately form an open source evaluation index.

Contributors

All

Language(Optional)

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/rtduino/RTduino.git
git@gitee.com:rtduino/RTduino.git
rtduino
RTduino
RTduino
master
Going to Help Center

Search

Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /