cpu: instead of cpp-style, use C-style comments

This commit is contained in:
Alexandre Abadie 2018-02-05 11:39:41 +01:00
parent aa57ea5b74
commit 7847a91e12
10 changed files with 32 additions and 29 deletions

View File

@ -44,10 +44,10 @@ extern "C" {
#define IAP_LOCATION (0x7FFFFFF1)
/* PLL */
#define PLLCON_PLLE (0x01) ///< PLL Enable
#define PLLCON_PLLD (0x00) ///< PLL Disable
#define PLLCON_PLLC (0x03) ///< PLL Connect
#define PLLSTAT_PLOCK (0x0400) //</ PLL Lock Status
#define PLLCON_PLLE (0x01) /**< PLL Enable */
#define PLLCON_PLLD (0x00) /**< PLL Disable */
#define PLLCON_PLLC (0x03) /**< PLL Connect */
#define PLLSTAT_PLOCK (0x0400) /**< PLL Lock Status */
/*
* @brief: Converts 'addr' to sector number

View File

@ -97,7 +97,7 @@ static void _set_brr(uart_t uart, uint32_t baudrate)
{
uint16_t brr;
#if defined(UART_STDIO_BAUDRATE)
// UBRR_VALUE and USE_2X are statically computed from <util/setbaud.h>
/* UBRR_VALUE and USE_2X are statically computed from <util/setbaud.h> */
if (baudrate == UART_STDIO_BAUDRATE) {
_update_brr(uart, UBRR_VALUE, USE_2X);
return;

View File

@ -249,7 +249,7 @@ void thread_yield_higher(void) {
}
// Use this interrupt to perform all context switches
/* Use this interrupt to perform all context switches */
ISR(AVR_CONTEXT_SWAP_INTERRUPT_VECT, ISR_NAKED) {
__context_save();
sched_run();

View File

@ -32,11 +32,11 @@ extern "C" {
* @see ::rtc_set_alarm
*/
typedef enum {
RTC_ALARM_DISABLED = 0x00, ///< Alarm disables
RTC_ALARM_MIN = 0x01, ///< Alarm mask for Minutes
RTC_ALARM_HOUR = 0x02, ///< Alarm mask for Hours
RTC_ALARM_DOW = 0x04, ///< Alarm mask for Day of Week
RTC_ALARM_DOM = 0x08 ///< Alarm mask for Day of Month
RTC_ALARM_DISABLED = 0x00, /**< Alarm disables */
RTC_ALARM_MIN = 0x01, /**< Alarm mask for Minutes */
RTC_ALARM_HOUR = 0x02, /**< Alarm mask for Hours */
RTC_ALARM_DOW = 0x04, /**< Alarm mask for Day of Week */
RTC_ALARM_DOM = 0x08 /**< Alarm mask for Day of Month */
} rtc_alarm_mask_t;
/**

View File

@ -51,9 +51,9 @@ void cpu_clock_scale(uint32_t source, uint32_t target, uint32_t *prescale)
lpc2387_pclk_scale(source, target, &pclksel, prescale);
PCLKSEL0 = (PCLKSEL0 & ~(BIT2 | BIT3)) | (pclksel << 2); // timer 0
PCLKSEL0 = (PCLKSEL0 & ~(BIT4 | BIT5)) | (pclksel << 4); // timer 1
PCLKSEL1 = (PCLKSEL1 & ~(BIT12 | BIT13)) | (pclksel << 12); // timer 2
PCLKSEL0 = (PCLKSEL0 & ~(BIT2 | BIT3)) | (pclksel << 2); /* timer 0 */
PCLKSEL0 = (PCLKSEL0 & ~(BIT4 | BIT5)) | (pclksel << 4); /* timer 1 */
PCLKSEL1 = (PCLKSEL1 & ~(BIT12 | BIT13)) | (pclksel << 12); /* timer 2 */
}
/******************************************************************************

View File

@ -26,7 +26,7 @@
extern "C" {
#endif
extern uintptr_t __stack_start; ///< end of user stack memory space
extern uintptr_t __stack_start; /**< end of user stack memory space */
/**
* @brief Scale lpc2387 cpu speed

View File

@ -32,9 +32,12 @@
/* pointer to reserved flash rom section for configuration data */
__attribute((aligned(256))) char configmem[256] __attribute__((section(".configmem")));
static unsigned int iap_command[5]; // contains parameters for IAP command
static unsigned int iap_result[2]; // contains results
typedef void (*IAP)(unsigned int[], unsigned int[]); // typedefinition for IAP entry function
/* contains parameters for IAP command */
static unsigned int iap_command[5];
/* contains results */
static unsigned int iap_result[2];
/* typedefinition for IAP entry function */
typedef void (*IAP)(unsigned int[], unsigned int[]);
IAP IAP_Entry;
/* some function prototypes */
@ -148,13 +151,13 @@ uint8_t flashrom_erase(uint8_t *addr)
static uint32_t iap(uint32_t code, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4)
{
iap_command[0] = code; // set command code
iap_command[1] = p1; // set 1st param
iap_command[2] = p2; // set 2nd param
iap_command[3] = p3; // set 3rd param
iap_command[4] = p4; // set 4th param
iap_command[0] = code; /* set command code */
iap_command[1] = p1; /* set 1st param */
iap_command[2] = p2; /* set 2nd param */
iap_command[3] = p3; /* set 3rd param */
iap_command[4] = p4; /* set 4th param */
((void (*)())0x7ffffff1)(iap_command, iap_result); // IAP entry point
((void (*)())0x7ffffff1)(iap_command, iap_result); /* IAP entry point */
return *iap_result;
}

View File

@ -71,9 +71,9 @@ NORETURN void cpu_switch_context_exit(void)
* thread_stack_init behavior. */
__attribute__((section (".fini9"))) void __main_epilogue(void) { __asm__("ret"); }
//----------------------------------------------------------------------------
// Processor specific routine - here for MSP
//----------------------------------------------------------------------------
/* ------------------------------------------------------------------------- */
/* Processor specific routine - here for MSP */
/* ------------------------------------------------------------------------- */
char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_start, int stack_size)
{
unsigned short stk = (unsigned short)((uintptr_t) stack_start + stack_size);

View File

@ -41,7 +41,7 @@
#else
#include <ucontext.h>
#endif
#endif // BSD/Linux
#endif /* BSD/Linux */
#include <netdb.h>
#include <ifaddrs.h>
#include <time.h>

View File

@ -31,7 +31,7 @@
void pm_set_lowest(void)
{
_native_in_syscall++; // no switching here
_native_in_syscall++; /* no switching here */
real_pause();
_native_in_syscall--;