mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-07 23:17:40 +00:00
Fix clock configuration for M4.
M0 launches baseband, so M4 clock can be set to PLL1. Provide a way to configure that per project, set to correct values for baseband project.
This commit is contained in:
parent
66320c39d4
commit
4e0de9c4ad
@ -41,3 +41,7 @@
|
|||||||
//#define LPC_ADC1_IRQ_PRIORITY 4
|
//#define LPC_ADC1_IRQ_PRIORITY 4
|
||||||
|
|
||||||
#define LPC43XX_M0APPTXEVENT_IRQ_PRIORITY 4
|
#define LPC43XX_M0APPTXEVENT_IRQ_PRIORITY 4
|
||||||
|
|
||||||
|
/* M4 is initialized by M0, which has already started PLL1 */
|
||||||
|
#define LPC43XX_M4_CLK 200000000
|
||||||
|
#define LPC43XX_M4_CLK_SRC 0x09
|
@ -41,7 +41,7 @@
|
|||||||
/* TODO: Somehow share this value between the M4 and M0 cores. The M0 always
|
/* TODO: Somehow share this value between the M4 and M0 cores. The M0 always
|
||||||
* runs at the same speed as the M4 core.
|
* runs at the same speed as the M4 core.
|
||||||
*/
|
*/
|
||||||
static halclock_t hal_clock_f = LPC43XX_M4_CLK_IRC;
|
static halclock_t hal_clock_f = LPC43XX_M4_CLK;
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local functions. */
|
/* Driver local functions. */
|
||||||
@ -74,7 +74,7 @@ void systick_adjust_period(const uint32_t counts_per_tick) {
|
|||||||
*/
|
*/
|
||||||
void hal_lld_init(void) {
|
void hal_lld_init(void) {
|
||||||
LPC_CGU->BASE_M4_CLK.AUTOBLOCK = 1;
|
LPC_CGU->BASE_M4_CLK.AUTOBLOCK = 1;
|
||||||
LPC_CGU->BASE_M4_CLK.CLK_SEL = 1;
|
LPC_CGU->BASE_M4_CLK.CLK_SEL = LPC43XX_M4_CLK_SRC;
|
||||||
|
|
||||||
/* SysTick initialization using the system clock.*/
|
/* SysTick initialization using the system clock.*/
|
||||||
systick_adjust_period(halLPCGetSystemClock() / CH_FREQUENCY - 1);
|
systick_adjust_period(halLPCGetSystemClock() / CH_FREQUENCY - 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user