BRISCITS
0.1
RISC "Real-Time" Scheduler
Main Page
Related Pages
Data Structures
Files
File List
Globals
src
brisc_delay.c
Go to the documentation of this file.
1
/******************************************************************************
2
________ ________ ___ ________ ________ ___ _________ ________
3
|\ __ \|\ __ \|\ \|\ ____\|\ ____\|\ \|\___ ___\\ ____\
4
\ \ \|\ /\ \ \|\ \ \ \ \ \___|\ \ \___|\ \ \|___ \ \_\ \ \___|_
5
\ \ __ \ \ _ _\ \ \ \_____ \ \ \ \ \ \ \ \ \ \ \_____ \
6
\ \ \|\ \ \ \\ \\ \ \|____|\ \ \ \____\ \ \ \ \ \ \|____|\ \
7
\ \_______\ \__\\ _\\ \__\____\_\ \ \_______\ \__\ \ \__\ ____\_\ \
8
\|_______|\|__|\|__|\|__|\_________\|_______|\|__| \|__| |\_________\
9
\|_________| \|_________|
10
11
MIT License
12
13
Copyright (c) 2021 Mike Sharkey
14
15
Permission is hereby granted, free of charge, to any person obtaining a copy
16
of this software and associated documentation files (the "Software"), to deal
17
in the Software without restriction, including without limitation the rights
18
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
copies of the Software, and to permit persons to whom the Software is
20
furnished to do so, subject to the following conditions:
21
22
The above copyright notice and this permission notice shall be included in all
23
copies or substantial portions of the Software.
24
25
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
SOFTWARE.
32
33
******************************************************************************/
34
#include <
brisc_delay.h
>
35
#include <
brisc_thread.h
>
36
37
38
void
b_delay_ms
( uint32_t ms )
39
{
40
brisc_systick_t
start =
b_thread_systick
();
41
b_thread_block_while
( (
b_thread_systick
() - start) < ms );
42
}
brisc_systick_t
#define brisc_systick_t
Definition:
brisc_thread.h:160
brisc_delay.h
brisc_thread.h
b_delay_ms
void b_delay_ms(uint32_t ms)
Introduce a delay while yielding CPU cyeles. Delay will be at least the specified number of milliseco...
Definition:
brisc_delay.c:38
b_thread_block_while
#define b_thread_block_while(cond)
Block while a condition exists.
Definition:
brisc_thread.h:183
b_thread_systick
brisc_systick_t b_thread_systick(void)
Definition:
brisc_thread.c:62
Generated by
1.8.11