Changeset 35 for trunk/firmware/App/SES/Core
- Timestamp:
- Oct 15, 2026, 3:03:59 PM (3 weeks ago)
- Location:
- trunk/firmware/App/SES/Core/Tasks/Src
- Files:
-
- 2 edited
-
mainTask.cpp (modified) (1 diff)
-
sdmmcTask.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/firmware/App/SES/Core/Tasks/Src/mainTask.cpp
r33 r35 16 16 HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port, LED_GREEN_Pin); 17 17 osDelay(1000U); 18 printf(" Programm is running at %u MHz\n", SystemCoreClock / 1000000U);18 printf("Main programm is running at %u MHz\n", SystemCoreClock / 1000000U); 19 19 20 20 } -
trunk/firmware/App/SES/Core/Tasks/Src/sdmmcTask.cpp
r34 r35 37 37 static int insertionDetectionCnt, extractionDetectionCnt; 38 38 39 fx_system_initialize(); // Initialize FileX 40 39 41 while(1) 40 42 { … … 57 59 } 58 60 else 59 {60 61 insertionDetectionCnt = 0; 61 printf("SD-card extraction detected\n");62 }63 62 break; 64 63 65 64 case SdCardState::Inserted: 66 if (HAL_GPIO_ReadPin(SD_PRESENCE_GPIO_Port, SD_PRESENCE_Pin) == SD_ NOT_PRESENT)65 if (HAL_GPIO_ReadPin(SD_PRESENCE_GPIO_Port, SD_PRESENCE_Pin) == SD_PRESENT) 67 66 { 68 extractionDetectionCnt = 0;69 if ( insertionDetectionCnt > (1000U / SD_PRESENCE_SCAN_RATE_ms))70 { // Here we can be sure that SD-card is really present71 if (sdLastState == SdCardState:: NotPresent)67 insertionDetectionCnt = 0; 68 if (extractionDetectionCnt > (1000U / SD_PRESENCE_SCAN_RATE_ms)) 69 { // Here we can be sure that SD-card is really extracted 70 if (sdLastState == SdCardState::Inserted) 72 71 { 73 sdLastState = sdCurrentState = SdCardState:: Inserted;74 printf("SD-card was inserted\n");72 sdLastState = sdCurrentState = SdCardState::NotPresent; 73 printf("SD-card was extracted\n"); 75 74 } 76 75 } 77 76 else 78 ++ insertionDetectionCnt;77 ++extractionDetectionCnt; 79 78 } 80 79 else 81 { 82 insertionDetectionCnt = 0; 83 printf("SD-card extraction detected\n"); 84 } 80 extractionDetectionCnt = 0; 85 81 break; 86 82 87 case SdCardState::Initialized: 88 break; 89 90 case SdCardState::Deinitialized: 91 break; 92 93 case SdCardState::Error: 94 break; 83 case SdCardState::Initialized: break; 84 case SdCardState::Deinitialized: break; 85 case SdCardState::Error: break; 95 86 } 96 87 osDelay(SD_PRESENCE_SCAN_RATE_ms);
Note:
See TracChangeset
for help on using the changeset viewer.
