moved sd card init, more functions static now

This commit is contained in:
Robin Müller 2021-07-28 17:48:08 +02:00
parent c0b91a4879
commit 1a4f907925
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 15 additions and 12 deletions

View File

@ -318,7 +318,7 @@ wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/rfoaistRd67yBbH/downloa
or the following command for Linux (could be useful for CI/CD)
```sh
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/2Fp2ag6NGnbtAsK/download/gcc-arm-linux-gnueabi.tar.gz
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/MRaeA2XnMXpZ5Pp/download/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
```
## Installing CMake and MSYS2 on Windows

View File

@ -20,6 +20,18 @@ CoreController::Copy CoreController::currentCopy = Copy::NO_COPY;
CoreController::CoreController(object_id_t objectId):
ExtendedControllerBase(objectId, objects::NO_OBJECT, 5) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
try {
result = sdCardInit();
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "CoreController::CoreController: SD card init failed" << std::endl;
}
}
catch(const std::filesystem::filesystem_error& e) {
sif::error << "CoreController::CoreController: sdCardInit failed with exception " <<
e.what() << std::endl;
}
initBootCopy();
}
@ -41,16 +53,6 @@ LocalPoolDataSetBase* CoreController::getDataSetHandle(sid_t sid) {
ReturnValue_t CoreController::initialize() {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
try {
result = sdCardInit();
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "CoreController::initialize: SD card init failed" << std::endl;
}
}
catch(const std::filesystem::filesystem_error& e) {
sif::error << "CoreController::initialize: sdCardInit failed with exception " << e.what()
<< std::endl;
}
result = scratch::writeNumber(scratch::ALLOC_FAILURE_COUNT, 0);
if(result != HasReturnvaluesIF::RETURN_OK) {
@ -374,6 +376,7 @@ ReturnValue_t CoreController::actionListDirectoryIntoFile(ActionId_t actionId,
}
ReturnValue_t CoreController::initBootCopy() {
// We could create this file even before the OBSW is started..
std::string fileName = "/tmp/curr_copy.txt";
std::string cmd = "xsc_boot_copy > " + fileName;
int result = std::system(cmd.c_str());

View File

@ -62,7 +62,7 @@ private:
SdCardManager::SdStatusPair& statusPair);
ReturnValue_t initVersionFile();
ReturnValue_t initBootCopy();
static ReturnValue_t initBootCopy();
ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t *data, size_t size);