Skip to content

Commit

Permalink
Merge pull request #25 from At-EC/private/riven/timeout
Browse files Browse the repository at this point in the history
Private/riven/timeout
  • Loading branch information
At-EC authored Jan 4, 2025
2 parents ea17ead + bf92e96 commit 2541c19
Show file tree
Hide file tree
Showing 43 changed files with 2,261 additions and 4,969 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
matrix:
path:
- check: './include'
exclude: '' # Nothing to exclude
exclude: './include/kernel/init.h' # Nothing to exclude
- check: './kernel'
exclude: '' # Nothing to exclude
- check: './clock'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kernal-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
working-directory: .github/remote_build/native_gcc
run: |
cmake -S . -B build
cmake --build build
# cmake --build build

# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
Expand Down
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ At-RTOS ported a template At-RTOS configuration header file [atos_configuration.
```
Your application will certainly need a different value, so set the kernel component instance number correctly. This is very often, but not always. It's according to your system design.
The symbols in the configuration header file look like `<kernel component>_INSTANCE_SUPPORTED_NUMBER`, and the kernel component is shown as the following table:
The symbols in the configuration header file look like `<kernel component>_RUNTIME_NUMBER_SUPPORTED`, and the kernel component is shown as the following table:
- THREAD
- SEMAPHORE
- EVENT
Expand All @@ -172,11 +172,12 @@ The following sample codes illustrate how to create your first thread:
/* Include the At-RTOS interface's header file. */
#include "at_rtos.h"
/* Define a thread hook to specific the stack size and prioriy of the thread */
OS_THREAD_DEFINE(defined_thread, 1024, 7); // Set the thread stack size to 1024 bytes and the schedule prioriy level to 7.
/* Define a thread stack */
#define STACK_SIZE 1024
OS_STACK_INIT(stack, STACK_SIZE);
/* User thread's entry function. */
static void the_thread_entry_function(void)
/* Thread entry function. */
static void entry_function(void)
{
while(1) {
os.thread_sleep(1000u);
Expand All @@ -186,17 +187,20 @@ static void the_thread_entry_function(void)
/* The main routine */
int main(void)
{
/* Initialize the your your thread. */
os_thread_id_t id = os.thread_init(defined_thread, the_thread_entry_function);
if (os.id_isInvalid(id)) {
printf("Thread %s init failed\n", id.pName);
/* Initialize a runtime preempt thread. */
os_thread_id_t runtime_id = os.thread_init(stack, STACK_SIZE, OS_PRIORITY_PREEMPT_SET(1), entry_function, "runtime_thread");
if (os.id_isInvalid(runtime_id)) {
printf("Thread %s init failed\n", runtime_id.pName);
}
/* The At-RTOS kernel schedule starts to run. */
os.schedule_run();
RUN_UNREACHABLE();
}
/* Initialize a static cooperation thread. */
OS_THREAD_INIT(static_id, OS_PRIORITY_COOPERATION_SET(2), STACK_SIZE, entry_function);
```

The following kernel H file path must be included in your project workshop.
Expand Down
6 changes: 3 additions & 3 deletions build_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
extern "C" {
#endif

#define ATOS_BUILD_TIME "2024-11-09,17:36"
#define ATOS_COMMIT_HEAD_ID "1b1d7b46ad853be05c9457cb5678884d09469fa3"
#define ATOS_BUILD_TIME "2025-01-04,14:34"
#define ATOS_COMMIT_HEAD_ID "0f76bfa999392681d06420ef38fe42551267c450"
#define ATOS_VERSION_MAJOR_NUMBER (1u)
#define ATOS_VERSION_MINOR_NUMBER (7u)
#define ATOS_VERSION_PATCH_NUMBER (6u)
#define ATOS_VERSION_PATCH_NUMBER (7u)

#define ATOS_VERSION_MAJOR_NUMBER_MASK (0x03FFu)
#define ATOS_VERSION_MAJOR_NUMBER_POS (22u)
Expand Down
9 changes: 0 additions & 9 deletions clock/clock_native_gcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
**/

#include "clock_tick.h"
#include "configuration.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* Data structure for location time clock
*/
Expand Down Expand Up @@ -136,7 +131,3 @@ void clock_time_init(time_report_handler_t pTime_function)

/* Nothing need to do for kernel cmake sample build. */
}

#ifdef __cplusplus
}
#endif
9 changes: 0 additions & 9 deletions clock/clock_systick.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
**/

#include "clock_tick.h"
#include "configuration.h"
#include "arch.h"
#include "ktype.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Convert the microsecond to clock count */
#define _CONVERT_MICROSENCOND_TO_COUNT(us) ((u32_t)(us) * (PORTAL_SYSTEM_CORE_CLOCK_MHZ)-1u)

Expand Down Expand Up @@ -258,7 +253,3 @@ void clock_time_init(time_report_handler_t pTime_function)
SysTick->VAL = 0x0u;
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk;
}

#ifdef __cplusplus
}
#endif
5 changes: 3 additions & 2 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include_directories(${KERNEL_PATH}/include/kernel)
target_sources(kernel_include
PUBLIC
${KERNEL_PATH}/include/arch.h

${KERNEL_PATH}/include/kernel/at_rtos.h
${KERNEL_PATH}/include/kernel/compiler.h
${KERNEL_PATH}/include/kernel/configuration.h
Expand All @@ -16,6 +16,7 @@ target_sources(kernel_include
${KERNEL_PATH}/include/kernel/postcode.h
${KERNEL_PATH}/include/kernel/timer.h
${KERNEL_PATH}/include/kernel/trace.h
${KERNEL_PATH}/include/kernel/typedef.h
${KERNEL_PATH}/include/kernel/type_def.h
${KERNEL_PATH}/include/kernel/ktype.h
${KERNEL_PATH}/include/kernel/init.h
)
11 changes: 1 addition & 10 deletions include/clock_tick.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
**/

#ifndef _CLOCK_TICK_H_
#define _CLOCK_TICK_H_

#include "typedef.h"

#ifdef __cplusplus
extern "C" {
#endif
#include "type_def.h"

/**
* Function pointer structure for the clock tells how much time has passed.
Expand All @@ -30,8 +25,4 @@ void clock_time_enable(void);
void clock_time_disable(void);
void clock_time_init(time_report_handler_t pTime_function);

#ifdef __cplusplus
}
#endif

#endif /* _CLOCK_TICK_H_ */
Loading

0 comments on commit 2541c19

Please sign in to comment.