單片機源程序如下:
- #include "main.h"
- #include "stm32_ub_led.h"
- #include "stm32_ub_ee_flash.h"
- int main(void)
- {
- ErrorStatus check;
- int32_t ee_wert;
- SystemInit(); // Quarz Einstellungen aktivieren
- // init der LEDs
- UB_Led_Init();
- // init vom virtuellen EEProm
- check=UB_EE_FLASH_Init();
- if(check==SUCCESS) {
- // gr黱e LED einschalten
- UB_Led_On(LED_GREEN);
- // EEprom Adresse 0x00 auslesen
- ee_wert=UB_EE_FLASH_Read(0x00);
- // test ob Inhalt stimmt
- if(ee_wert==0x3AC4) {
- // Inhalt ist richtig
- UB_Led_On(LED_BLUE);
- }
- else {
- // wenn Inhalt nicht stimmt
- UB_Led_On(LED_ORANGE);
- // Adresse 0x00 mit Wert 0x3AC4 beschreiben
- UB_EE_FLASH_Write(0x00,0x3AC4);
- }
- }
- else {
- // Fehler
- UB_Led_On(LED_RED);
- }
- while(1)
- {
- }
- }
復制代碼
所有資料51hei提供下載:
ub_stm32f4_ee_flash_v100.zip
(5.77 KB, 下載次數: 16)
2019-5-15 19:19 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
|