From 5003e2df6ff122bdf2b230e436f28ad482f8bf77 Mon Sep 17 00:00:00 2001 From: bmy <2583236812@qq.com> Date: Sat, 3 Aug 2024 12:28:58 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E5=A2=9E=E5=8A=A0=E8=87=AA=E6=A3=80?= =?UTF-8?q?=E9=97=AA=E7=81=AF=E5=8A=A8=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/src/main.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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();