SD Card Access
The HCC library is able to support multi-task operations on SD-Card. However, only one SD-Card can be active at a time. Therefore the currently active SD-Card needs to be the same for the whole satellite. The SD Card Handler will be used to switch the active SD-Card with a command. If this command is registered, all active tasks using the SD-Card directly will get a notification message to yield SD-Card operations. The SD-Card handler checks up to three cycles whether all operations have ceased (by checking a counting semaphore) and if this is the case, change the active SD-Card. After that, all tasks using the SD-Card can use a getter function to check that the active SD-Card variable has changed and if this is the case, commence operation again with the changed SD-Card. On restart, the active SD-Card setting will be deduced from the preferred SD-Card variable, which is also stored in FRAM.
If file operations were going on, events will be triggered to notify ground about failed or cancelled file operations. The PLOC handler will send a special reply to the PLOC to cancel current file operations.