allow override of XOSC_MHZ (#644)

* And increased assertion limit to 50 as 15 was the limit for the oscillator but not for XIN
This commit is contained in:
Graham Sanderson 2021-11-01 08:11:21 -05:00 committed by GitHub
parent d7358e4ed8
commit da476610e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -36,7 +36,10 @@
#define PIO_INSTRUCTION_COUNT _u(32) #define PIO_INSTRUCTION_COUNT _u(32)
// PICO_CONFIG: XOSC_MHZ, The crystal oscillator frequency in Mhz, type=int, default=12, advanced=true, group=hardware_base
#ifndef XOSC_MHZ
#define XOSC_MHZ _u(12) #define XOSC_MHZ _u(12)
#endif
#endif #endif

View File

@ -13,8 +13,8 @@
#include "hardware/regs/xosc.h" #include "hardware/regs/xosc.h"
#include "hardware/xosc.h" #include "hardware/xosc.h"
#if XOSC_MHZ < 1 || XOSC_MHZ > 15 #if XOSC_MHZ < 1 || XOSC_MHZ > 50
#error XOSC_MHZ must be in the range 1-15 #error XOSC_MHZ must be in the range 1-50
#endif #endif
#define STARTUP_DELAY (((((XOSC_MHZ * MHZ) / 1000) + 128) / 256) * PICO_XOSC_STARTUP_DELAY_MULTIPLIER) #define STARTUP_DELAY (((((XOSC_MHZ * MHZ) / 1000) + 128) / 256) * PICO_XOSC_STARTUP_DELAY_MULTIPLIER)