Working fork to test F0 application

Dependents:   ppCANOpen_Example

Fork of CANnucleo by Zoltan Hudak

Revision:
13:a3e2be3d49a2
Parent:
12:c45310ff2233
Child:
14:0344705e6fb8
--- a/stm32f3xx_hal_msp.c	Tue Dec 22 20:46:47 2015 +0000
+++ b/stm32f3xx_hal_msp.c	Wed Dec 23 10:37:01 2015 +0000
@@ -112,10 +112,10 @@
         GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
         GPIO_InitStruct.Pull = GPIO_PULLUP;
 #if defined(TARGET_NUCLEO_F302R8) || \
-        defined(TARGET_NUCLEO_F303RE) || \
-        defined(TARGET_NUCLEO_F303K8)
+        defined(TARGET_NUCLEO_F303RE)       
         GPIO_InitStruct.Alternate =  GPIO_AF7_CAN;
-#elif defined(TARGET_NUCLEO_F334R8) || \
+#elif defined(TARGET_NUCLEO_F303K8) || \
+        defined(TARGET_NUCLEO_F334R8) || \
         defined(TARGET_DISCO_F334C8)
         GPIO_InitStruct.Alternate =  GPIO_AF9_CAN;
 #endif
@@ -127,15 +127,17 @@
         GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
         GPIO_InitStruct.Pull = GPIO_PULLUP;
 #if defined(TARGET_NUCLEO_F302R8) || \
-        defined(TARGET_NUCLEO_F303RE) || \
-        defined(TARGET_NUCLEO_F303K8)
+        defined(TARGET_NUCLEO_F303RE)       
         GPIO_InitStruct.Alternate =  GPIO_AF7_CAN;
-#elif defined(TARGET_NUCLEO_F334R8) || \
+#elif defined(TARGET_NUCLEO_F303K8) || \
+        defined(TARGET_NUCLEO_F334R8) || \
         defined(TARGET_DISCO_F334C8)
         GPIO_InitStruct.Alternate =  GPIO_AF9_CAN;
 #endif
+
         HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
     }
+#if !defined(TARGET_NUCLEO_F303K8)
     else
     if((_rxPin == PB_8) && (_txPin == PB_9)) {
         /* CAN1 Periph clock enable */
@@ -150,8 +152,7 @@
         GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
         GPIO_InitStruct.Pull = GPIO_PULLUP;
 #if defined(TARGET_NUCLEO_F302R8) || \
-        defined(TARGET_NUCLEO_F303RE) || \
-        defined(TARGET_NUCLEO_F303K8)
+        defined(TARGET_NUCLEO_F303RE)
         GPIO_InitStruct.Alternate =  GPIO_AF7_CAN;
 #elif defined(TARGET_NUCLEO_F334R8) || \
         defined(TARGET_DISCO_F334C8)
@@ -165,8 +166,7 @@
         GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
         GPIO_InitStruct.Pull = GPIO_PULLUP;
 #if defined(TARGET_NUCLEO_F302R8) || \
-        defined(TARGET_NUCLEO_F303RE) || \
-        defined(TARGET_NUCLEO_F303K8)
+        defined(TARGET_NUCLEO_F303RE)
         GPIO_InitStruct.Alternate =  GPIO_AF7_CAN;
 #elif defined(TARGET_NUCLEO_F334R8) || \
         defined(TARGET_DISCO_F334C8)
@@ -174,6 +174,7 @@
 #endif
         HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
     }
+#endif
     else
         return;
     /* NVIC configuration for CAN1 Reception complete interrupt */