Commit ff6a03d6 authored by Alan Wood's avatar Alan Wood

Added conditional for external clock conf along with comments to change settings

parent 39f96060
......@@ -15,19 +15,17 @@
******************************************************************************/
#include "mystorm.h"
// // Digital pins for controlling and serial programming of Ice40
// DigitalIn done(PB_7);
// DigitalOut* rst = new DigitalOut(PB_6);
// DigitalOut* cs = new DigitalOut(PD_2);
// DigitalOut* mosi = new DigitalOut(PB_5);
// DigitalOut* sclk = new DigitalOut(PB_3);
// // Not used, surplus to requirement?
// DigitalIn* miso = new DigitalIn(PB_4);
// // Status indicator led
// DigitalOut *myled = new DigitalOut(PA_15);
/* use this to enable external clock, mbed + nucleo_l476rg doesn't use highspeed xtal
/* you also have to modify ~/.platformio/packages/framework-mbed/hal/targets/cmsis/TARGET_STML4/TARGET_NUCLEO_L476RG/system_stm32l4xx.c
/* line 135 #define USE_PLL_HSE_XTAL (1) // Use external xtal
/* Lines 430 - 434:
/* RCC_OscInitStruct.PLL.PLLM = 1; // VCO input clock = 12 MHz (12 MHz / 1)
/* RCC_OscInitStruct.PLL.PLLN = 16; // VCO output clock = 192 MHz (12 MHz * )
/* RCC_OscInitStruct.PLL.PLLP = 7; // PLLSAI3 clock = 27.4 MHz (192 MHz / 7)
/* RCC_OscInitStruct.PLL.PLLQ = 4; // USB clock (PLL48M1) = 48 MHz (192 MHz / 4) --> OK for USB
/* RCC_OscInitStruct.PLL.PLLR = 4; // PLL clock = 48 MHz (192 MHz / 4)
#define EXTCLK
*/
MyStorm ms(PB_5, PB_4, PB_3, PB_7, PB_6, PD_2,PA_15);
......@@ -36,7 +34,9 @@ extern uint8_t _binary_bitmap_bin_start;
extern uint8_t _binary_bitmap_bin_end;
int main() {
#ifdef EXTCLK
SystemCoreClockUpdate();
#endif
//Lets get the bit image size
uint32_t len = &_binary_bitmap_bin_end - &_binary_bitmap_bin_start;
//Initialise anfd program Ice40
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment