aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--projects/board-test/led-test.c8
-rw-r--r--stm-init.c2
-rw-r--r--stm-led.h10
3 files changed, 14 insertions, 6 deletions
diff --git a/projects/board-test/led-test.c b/projects/board-test/led-test.c
index 5e4401f..7e72788 100644
--- a/projects/board-test/led-test.c
+++ b/projects/board-test/led-test.c
@@ -7,6 +7,14 @@
#define DELAY() HAL_Delay(125)
+/*
+ * PK4 = ARM_LED1 - GREEN
+ * PK5 = ARM_LED2 - RED
+ * PK6 = ARM_LED3 - BLUE
+ ' PK7 = ARM_LED4 - YELLOW
+ */
+
+
void toggle_led(uint32_t times, uint32_t led_pin)
{
uint32_t i;
diff --git a/stm-init.c b/stm-init.c
index 0c0fd0f..216f127 100644
--- a/stm-init.c
+++ b/stm-init.c
@@ -169,7 +169,7 @@ static void MX_GPIO_Init(void)
GPIO_InitTypeDef GPIO_InitStruct;
/* GPIO Ports Clock Enable */
- __GPIOJ_CLK_ENABLE();
+ __GPIOK_CLK_ENABLE();
/* Configure LED GPIO pins PJ1==red, PJ2==yellow, PJ3==green, PJ4==blue */
GPIO_InitStruct.Pin = LED_RED | LED_YELLOW | LED_GREEN | LED_BLUE;
diff --git a/stm-led.h b/stm-led.h
index 5af084a..bcac463 100644
--- a/stm-led.h
+++ b/stm-led.h
@@ -37,11 +37,11 @@
#include "stm32f4xx_hal.h"
-#define LED_PORT GPIOJ
-#define LED_RED GPIO_PIN_1
-#define LED_YELLOW GPIO_PIN_2
-#define LED_GREEN GPIO_PIN_3
-#define LED_BLUE GPIO_PIN_4
+#define LED_PORT GPIOK
+#define LED_RED GPIO_PIN_5
+#define LED_YELLOW GPIO_PIN_7
+#define LED_GREEN GPIO_PIN_4
+#define LED_BLUE GPIO_PIN_6
#define led_on(pin) HAL_GPIO_WritePin(LED_PORT,pin,SET)
#define led_off(pin) HAL_GPIO_WritePin(LED_PORT,pin,RESET)