| 467 | #endif |
| 468 | |
| 469 | void rt_demo_thread_entry(void* parameter) |
| 470 | { |
| 471 | emu_all_disable(); |
| 472 | |
| 473 | #if 0 //defined(EFM32_USING_ACCEL) |
| 474 | { |
| 475 | struct efm32_accel_result_t result; |
| 476 | |
| 477 | rt_kprintf(">>> waiting\n"); |
| 478 | rt_thread_delay(6000); |
| 479 | rt_kprintf(">>> start\n"); |
| 480 | while(1) |
| 481 | { |
| 482 | efm_accel_get_data(&result); |
| 483 | rt_kprintf("Accel x: %x\n", result.x); |
| 484 | rt_kprintf("Accel y: %x\n", result.y); |
| 485 | rt_kprintf("Accel z: %x\n\n", result.z); |
| 486 | rt_thread_delay(200); |
| 487 | } |
| 488 | } |
| 489 | #endif |
| 490 | |
| 491 | #if defined(RT_USING_DFS) |
| 492 | { |
| 493 | rt_kprintf("File system DEMO start...\n"); |
| 494 | /* Filesystem Initialization */ |
| 495 | dfs_init(); |
| 496 | |
| 497 | #if defined(RT_USING_DFS_ELMFAT) |
| 498 | /* init the elm chan FatFs filesystam*/ |
| 499 | elm_init(); |
| 500 | |
| 501 | #if defined(EFM32_USING_SPISD) |
| 502 | /* mount sd card fat partition 1 as root directory */ |
| 503 | if (dfs_mount(SPISD_DEVICE_NAME, "/", "elm", 0, 0) == 0) |
| 504 | { |
| 505 | rt_kprintf("FatFs init OK\n"); |
| 506 | } |
| 507 | else |
| 508 | { |
| 509 | rt_kprintf("FatFs init failed!\n"); |
| 510 | } |
| 511 | #endif |
| 512 | #endif |
| 513 | rt_kprintf("File system DEMO end.\n"); |
| 514 | } |
| 515 | #endif |
| 516 | |
| 517 | #ifdef EFM32_USING_SFLASH |
| 518 | { |
| 519 | rt_kprintf("SPI Flash DEMO start...\n"); |
| 520 | |
| 521 | rt_uint8_t i; |
| 522 | rt_uint8_t test[] = "123456789ABCDEF"; |
| 523 | rt_uint8_t buf[30], buf2[30]; |
| 524 | |
| 525 | efm_spiFlash_cmd(sflash_inst_rdid_l, EFM32_NO_DATA, buf, sizeof(buf)); |
| 526 | rt_kprintf("Manuf ID: %x\n", buf[0]); |
nothing calls this directly
no test coverage detected