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

mips: Correct usage of USEMODULE #8360

Merged
merged 1 commit into from
Jan 15, 2018
Merged
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
4 changes: 4 additions & 0 deletions boards/pic32-clicker/clicker.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "periph/uart.h"
#include "bitarithm.h"
#include "board.h"
#include "cpu.h"

extern void dummy(void);

Expand All @@ -36,6 +37,9 @@ void board_init(void)
LED1_OFF;
LED2_OFF;

/* initialize the CPU */
cpu_init();

/* Stop the linker from throwing away the PIC32 config register settings */
dummy();
}
Expand Down
6 changes: 4 additions & 2 deletions boards/pic32-wifire/wifire.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "periph/uart.h"
#include "bitarithm.h"
#include "board.h"
#include "cpu.h"

extern void dummy(void);

Expand All @@ -32,8 +33,6 @@ void board_init(void)
uart_init(DEBUG_VIA_UART, DEBUG_UART_BAUD, NULL, 0);
#endif

hwrng_init();

/* Turn off all LED's */
gpio_init(LED1_PIN, GPIO_OUT);
gpio_init(LED2_PIN, GPIO_OUT);
Expand All @@ -44,6 +43,9 @@ void board_init(void)
LED3_OFF;
LED4_OFF;

/* initialize the CPU */
cpu_init();

/* Stop the linker from throwing away the PIC32 config register settings */
dummy();
}
Expand Down
8 changes: 8 additions & 0 deletions cpu/mips32r2_common/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@

#include "periph/uart.h"
#include "periph/timer.h"
#include "periph/init.h"
#include "panic.h"
#include "kernel_init.h"
#include "cpu.h"
#include "board.h"


void mips_start(void);

extern void _fini(void);
Expand Down Expand Up @@ -71,3 +73,9 @@ void panic_arch(void)
while (1) {
}
}

void cpu_init(void)
{
/* trigger static peripheral initialization */
periph_init();
}
1 change: 0 additions & 1 deletion cpu/mips_pic32_common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ USEMODULE += mips_pic32_common
USEMODULE += mips_pic32_common_periph

USEMODULE += periph_common
USEMODULE += periph_hwrng
5 changes: 5 additions & 0 deletions cpu/mips_pic32mx/include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ static inline void cpu_print_last_instruction(void)
/* This function must exist else RIOT won't compile */
}

/**
* @brief Initialize the CPU, set IRQ priorities
*/
void cpu_init(void);

#ifdef __cplusplus
}
#endif
Expand Down
5 changes: 5 additions & 0 deletions cpu/mips_pic32mz/include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ static inline void cpu_print_last_instruction(void)
/* This function must exist else RIOT won't compile */
}

/**
* @brief Initialize the CPU, set IRQ priorities
*/
void cpu_init(void);

#ifdef __cplusplus
}
#endif
Expand Down