Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplelink: Fix clang-llvm compiler errors/warnings #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 41 additions & 5 deletions simplelink/source/ti/devices/cc13x2_cc26x2/driverlib/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ CPUcpsid(void)
// you expect in R0.
return(0);
}
#elif defined(__clang__)
uint32_t __attribute__((naked))
CPUcpsid(void)
{
// Read PRIMASK and disable interrupts
__asm volatile (" mrs r0, PRIMASK\n"
" cpsid i\n"
" bx lr\n"
);
}
#else
uint32_t __attribute__((naked))
CPUcpsid(void)
Expand Down Expand Up @@ -176,6 +186,15 @@ CPUprimask(void)
// you expect in R0.
return(0);
}
#elif defined(__clang__)
uint32_t __attribute__((naked))
CPUprimask(void)
{
// Read PRIMASK
__asm volatile (" mrs r0, PRIMASK\n"
" bx lr\n"
);
}
#else
uint32_t __attribute__((naked))
CPUprimask(void)
Expand Down Expand Up @@ -246,6 +265,16 @@ CPUcpsie(void)
// you expect in R0.
return(0);
}
#elif defined(__clang__)
uint32_t __attribute__((naked))
CPUcpsie(void)
{
// Read PRIMASK and enable interrupts.
__asm volatile (" mrs r0, PRIMASK\n"
" cpsie i\n"
" bx lr\n"
);
}
#else
uint32_t __attribute__((naked))
CPUcpsie(void)
Expand Down Expand Up @@ -314,6 +343,15 @@ CPUbasepriGet(void)
// you expect in R0.
return(0);
}
#elif defined(__clang__)
uint32_t __attribute__((naked))
CPUbasepriGet(void)
{
// Read BASEPRI.
__asm volatile (" mrs r0, BASEPRI\n"
" bx lr\n"
);
}
#else
uint32_t __attribute__((naked))
CPUbasepriGet(void)
Expand Down Expand Up @@ -386,11 +424,9 @@ void __attribute__((naked))
CPUdelay(uint32_t ui32Count)
{
// Loop the specified number of times
__asm volatile ("%=: subs %0, #1\n"
" bne %=b\n"
" bx lr\n"
: /* No output */
: "r" (ui32Count)
__asm volatile ("CPUdel: subs r0, #1\n"
" bne CPUdel\n"
" bx lr\n"
);
}
#endif
4 changes: 1 addition & 3 deletions simplelink/source/ti/devices/cc13x2_cc26x2/driverlib/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,8 @@ __STATIC_INLINE void __attribute__ ((naked))
CPUbasepriSet(uint32_t ui32NewBasepri)
{
// Set the BASEPRI register.
__asm volatile (" msr BASEPRI, %0\n"
__asm volatile (" msr BASEPRI, r0\n"
" bx lr\n"
: /* No output */
: "r" (ui32NewBasepri)
);
}
#pragma GCC diagnostic pop
Expand Down