From 1105733dc07562240bd061a1d8b0869c8c596805 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Thu, 09 Oct 2025 00:41:09 +0800 Subject: [PATCH] ISL1208 RTC示例程序 --- Core/Src/main.c | 23 +++++++---------------- 1 files changed, 7 insertions(+), 16 deletions(-) diff --git a/Core/Src/main.c b/Core/Src/main.c index 3344439..4e17432 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -28,7 +28,7 @@ /* USER CODE BEGIN Includes */ #include "miscdev.h" #include "sht20.h" -#include "w25q.h" +#include "isl1208.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -71,8 +71,7 @@ { /* USER CODE BEGIN 1 */ - int rv; - float temperature, humidity; + /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ @@ -99,27 +98,19 @@ MX_TIM1_Init(); MX_SPI1_Init(); /* USER CODE BEGIN 2 */ + beep_start(2, 300); + printf("ISKBoard ISL1208 RTC example.\r\n"); + set_rtctime("2025-08-08 08:08:08"); - spinor_test(); - - do {} while(1); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { - rv = sht20_sample_TrH(&temperature, &humidity); - if( rv ) - { - printf("ERROR: SHT20 sample data failure, rv=%d\r\n", rv); - } - else - { - printf("SHT20 sample temperature: %.2f relative humidity: %.1f%%\r\n", temperature, humidity); - } - HAL_Delay(1000); + print_rtctime(); + HAL_Delay(1000); /* USER CODE END WHILE */ -- Gitblit v1.9.1