Get A13/A14 working on Espruino board (these were JTAG)

This commit is contained in:
Gordon Williams 2013-11-04 18:04:13 +00:00
parent 412fd7de2c
commit d91ee0519e
2 changed files with 9 additions and 0 deletions

View File

@ -669,6 +669,11 @@ void jshInit() {
GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE);
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);
#endif
#ifdef ESPRUINOBOARD
// reclaim A13 and A14 (do we need the two above now?)
GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable, ENABLE); // Disable JTAG/SWD so pins are available
#endif
NVIC_InitTypeDef NVIC_InitStructure;
/* Note, DO NOT set SysTicck priority using NVIC_Init. It is done above by NVIC_SetPriority */

View File

@ -174,6 +174,10 @@ void initHardware() {
RCC_APB2Periph_GPIOG |
RCC_APB2Periph_AFIO, ENABLE);
#endif
#ifdef ESPRUINOBOARD
// reclaim A13 and A14 (do we need the two above now?)
GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable, ENABLE); // Disable JTAG/SWD so pins are available
#endif
RCC_PCLK1Config(RCC_HCLK_Div8); // PCLK1 must be >8 Mhz for USB to work
RCC_PCLK2Config(RCC_HCLK_Div16);