Browse Source

Fix EXTI pin init. Fix HSV2LED warnings.

Vladimir N. Shilov 3 years ago
parent
commit
77200fb385
1 changed files with 5 additions and 3 deletions
  1. 5 3
      Src/board.c

+ 5 - 3
Src/board.c

@@ -165,8 +165,8 @@ void showDigits(uint8_t * dig)
  * @return none. RGB value out direct to LED.
  */
 void HSV2LED(const int hue, const uint8_t sat, const uint8_t val) {
-  int r, g, b, base;
-  uint8_t colors[3];
+  int base;
+  uint8_t colors[3] = {0};
 
   if (sat == 0)
   { // Achromatic color (gray).
@@ -275,10 +275,12 @@ static void GPIO_Init(void)
   EXTI->FTSR1 = EXTI_FTSR1_FT14;
   // external interrupt selection - PC14 to EXTI14
   EXTI->EXTICR[3] = EXTI_EXTICR4_EXTI14_1;
-
   /* EXTI interrupt init*/
   NVIC_SetPriority(EXTI4_15_IRQn, 0);
   NVIC_EnableIRQ(EXTI4_15_IRQn);
+  /* set GPIO modes */
+  GPIO_SetPinMode(IRQ_GPIO_Port, IRQ_Pin, GPIO_MODE_IN);
+  //GPIO_SetPinPull(IRQ_GPIO_Port, IRQ_Pin, GPIO_PUPDR_NO);
 
   /* L0, L1, L2, L3 - IN-15 symbols control, PP out, high speed, pull down */
   GPIO_SetPinMode(LC0_GPIO_Port, LC0_Pin, GPIO_MODE_OUT);