mips: Correct usage of USEMODULE

In CPU definitions we should not be explicilty naming peripheral modules to use
via USEMODULE (one should use FEATURES_PROVIDED instead).
Plus add missing cpu_init() and periph_init() methods.
This commit removes periph_hwrng support from the pic32mx cpu builds as
pic32mx does not have hwrng only pic32mz does.
This commit is contained in:
Neil Jones 2018-01-15 11:04:20 +00:00
parent bec3f12e0b
commit e297a71e8c
6 changed files with 26 additions and 3 deletions

View File

@ -13,6 +13,7 @@
#include "periph/uart.h"
#include "bitarithm.h"
#include "board.h"
#include "cpu.h"
extern void dummy(void);
@ -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();
}

View File

@ -15,6 +15,7 @@
#include "periph/uart.h"
#include "bitarithm.h"
#include "board.h"
#include "cpu.h"
extern void dummy(void);
@ -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);
@ -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();
}

View File

@ -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);
@ -71,3 +73,9 @@ void panic_arch(void)
while (1) {
}
}
void cpu_init(void)
{
/* trigger static peripheral initialization */
periph_init();
}

View File

@ -6,4 +6,3 @@ USEMODULE += mips_pic32_common
USEMODULE += mips_pic32_common_periph
USEMODULE += periph_common
USEMODULE += periph_hwrng

View File

@ -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

View File

@ -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