diff --git a/project/src/main.c b/project/src/main.c index 7531dc4..df04778 100644 --- a/project/src/main.c +++ b/project/src/main.c @@ -69,10 +69,10 @@ /* add user code end 0 */ /** - * @brief main function. - * @param none - * @retval none - */ + * @brief main function. + * @param none + * @retval none + */ int main(void) { /* add user code begin 1 */ @@ -136,12 +136,21 @@ int main(void) by_messy_init(); LOGD("frame init done"); + /* self test */ + gpio_bits_write(GPIOB, GPIO_PINS_6, FALSE); // 灯条 + gpio_bits_write(GPIOB, GPIO_PINS_7, FALSE); // 蜂鸣器 + + for (uint8_t i = 0; i < 4; i++) { + gpio_bits_write(GPIOB, GPIO_PINS_6, !gpio_output_data_bit_read(GPIOB, GPIO_PINS_6)); // 灯条 + gpio_bits_write(GPIOB, GPIO_PINS_7, !gpio_output_data_bit_read(GPIOB, GPIO_PINS_7)); // 蜂鸣器 + DWT_Delay(100000); + } + LOGI("init done"); /* add user code end 2 */ - while(1) - { + while (1) { /* add user code begin 3 */ by_messy_loop(); by_motion_loop();