Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ch32v003fun
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Horn
ch32v003fun
Commits
0c138b89
Unverified
Commit
0c138b89
authored
1 year ago
by
CNLohr
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #257 from mrx23dot/isr_asm
added __isenabled_irq __get_cpu_sp, minor linting
parents
2fa932a6
b3a4ef4a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ch32v003fun/ch32v003fun.h
+39
-0
39 additions, 0 deletions
ch32v003fun/ch32v003fun.h
with
39 additions
and
0 deletions
ch32v003fun/ch32v003fun.h
+
39
−
0
View file @
0c138b89
...
...
@@ -4563,6 +4563,45 @@ RV_STATIC_INLINE void __disable_irq()
__asm
volatile
(
"csrw mstatus, %0"
:
:
"r"
(
result
)
);
}
/*********************************************************************
* @fn __isenabled_irq
*
* @brief Is Global Interrupt enabled
*
* @return 1: yes, 0: no
*/
RV_STATIC_INLINE
uint8_t
__isenabled_irq
(
void
)
{
uint32_t
result
;
__asm
volatile
(
#if __GNUC__ > 10
".option arch, +zicsr
\n
"
#endif
"csrr %0,"
"mstatus"
:
"=r"
(
result
));
return
(
result
&
0x08
)
!=
0u
;
}
/*********************************************************************
* @fn __get_cpu_sp
*
* @brief Get stack pointer
*
* @return stack pointer
*/
RV_STATIC_INLINE
uint32_t
__get_cpu_sp
(
void
);
RV_STATIC_INLINE
uint32_t
__get_cpu_sp
(
void
)
{
uint32_t
result
;
__asm
volatile
(
#if __GNUC__ > 10
".option arch, +zicsr
\n
"
#endif
"mv %0, sp"
:
"=r"
(
result
));
return
result
;
}
/*********************************************************************
* @fn __NOP
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment