[target][dartuinoP0] add debug led support
This should blink 2 of the green leds when working in a thread and inside irq context
This commit is contained in:
@@ -107,6 +107,12 @@ void target_early_init(void)
|
|||||||
|
|
||||||
// now that the uart gpios are configured, enable the debug uart.
|
// now that the uart gpios are configured, enable the debug uart.
|
||||||
stm32_debug_early_init();
|
stm32_debug_early_init();
|
||||||
|
|
||||||
|
// default all the debug leds to off
|
||||||
|
target_set_debug_led(0, false);
|
||||||
|
target_set_debug_led(1, false);
|
||||||
|
target_set_debug_led(2, false);
|
||||||
|
target_set_debug_led(3, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t* gen_mac_address(void)
|
static uint8_t* gen_mac_address(void)
|
||||||
@@ -467,3 +473,28 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
|
|||||||
HAL_NVIC_EnableIRQ(OTG_HS_IRQn);
|
HAL_NVIC_EnableIRQ(OTG_HS_IRQn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void target_set_debug_led(unsigned int led, bool on)
|
||||||
|
{
|
||||||
|
uint32_t gpio;
|
||||||
|
|
||||||
|
switch (led) {
|
||||||
|
case 0:
|
||||||
|
gpio = GPIO_LED112;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
gpio = GPIO_LED113;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
gpio = GPIO_LED114;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
gpio = GPIO_LED115;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gpio_set(gpio, on ? GPIO_LED_ON : GPIO_LED_OFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,9 @@ GLOBAL_DEFINES += \
|
|||||||
PLL_N_VALUE=336 \
|
PLL_N_VALUE=336 \
|
||||||
PLL_P_VALUE=2 \
|
PLL_P_VALUE=2 \
|
||||||
\
|
\
|
||||||
PKTBUF_POOL_SIZE=16
|
PKTBUF_POOL_SIZE=16 \
|
||||||
|
\
|
||||||
|
TARGET_HAS_DEBUG_LED=1
|
||||||
|
|
||||||
GLOBAL_INCLUDES += $(LOCAL_DIR)/include
|
GLOBAL_INCLUDES += $(LOCAL_DIR)/include
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user