This commit is contained in:
parent
2262a15e35
commit
dd211cdf54
@ -90,7 +90,7 @@ CoreController::~CoreController() {}
|
||||
|
||||
ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) {
|
||||
ReturnValue_t result = paramHelper.handleParameterMessage(message);
|
||||
if(result == returnvalue::OK) {
|
||||
if (result == returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return ExtendedControllerBase::handleCommandMessage(message);
|
||||
@ -160,7 +160,7 @@ ReturnValue_t CoreController::initialize() {
|
||||
}
|
||||
|
||||
result = paramHelper.initialize();
|
||||
if(result != returnvalue::OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -2147,26 +2147,25 @@ ReturnValue_t CoreController::getParameter(uint8_t domainId, uint8_t uniqueIdent
|
||||
ParameterWrapper *parameterWrapper,
|
||||
const ParameterWrapper *newValues,
|
||||
uint16_t startAtIndex) {
|
||||
if(domainId != 0) {
|
||||
if (domainId != 0) {
|
||||
return HasParametersIF::INVALID_DOMAIN_ID;
|
||||
}
|
||||
if(uniqueIdentifier >= ParamId::NUM_IDS) {
|
||||
if (uniqueIdentifier >= ParamId::NUM_IDS) {
|
||||
return HasParametersIF::INVALID_IDENTIFIER_ID;
|
||||
}
|
||||
uint8_t newPrefSd;
|
||||
ReturnValue_t result = newValues->getElement(&newPrefSd);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
// Only SD card 0 (0) and 1 (1) are allowed values.
|
||||
if(newPrefSd > 1) {
|
||||
return HasParametersIF::INVALID_VALUE;
|
||||
}
|
||||
result = sdcMan->setPreferredSdCard(static_cast<sd::SdCard>(newPrefSd));
|
||||
if(result != returnvalue::OK) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
parameterWrapper->set(prefSdRaw);
|
||||
return returnvalue::OK;
|
||||
|
||||
uint8_t newPrefSd;
|
||||
ReturnValue_t result = newValues->getElement(&newPrefSd);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
// Only SD card 0 (0) and 1 (1) are allowed values.
|
||||
if (newPrefSd > 1) {
|
||||
return HasParametersIF::INVALID_VALUE;
|
||||
}
|
||||
result = sdcMan->setPreferredSdCard(static_cast<sd::SdCard>(newPrefSd));
|
||||
if (result != returnvalue::OK) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
parameterWrapper->set(prefSdRaw);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -50,13 +50,9 @@ struct RebootFile {
|
||||
xsc::Copy mechanismNextCopy = xsc::Copy::NO_COPY;
|
||||
};
|
||||
|
||||
class CoreController : public ExtendedControllerBase,
|
||||
public ReceivesParameterMessagesIF {
|
||||
class CoreController : public ExtendedControllerBase, public ReceivesParameterMessagesIF {
|
||||
public:
|
||||
enum ParamId: uint8_t {
|
||||
PREF_SD = 0,
|
||||
NUM_IDS
|
||||
};
|
||||
enum ParamId : uint8_t { PREF_SD = 0, NUM_IDS };
|
||||
|
||||
static xsc::Chip CURRENT_CHIP;
|
||||
static xsc::Copy CURRENT_COPY;
|
||||
@ -233,8 +229,8 @@ class CoreController : public ExtendedControllerBase,
|
||||
|
||||
MessageQueueId_t getCommandQueue() const override;
|
||||
ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueIdentifier,
|
||||
ParameterWrapper *parameterWrapper,
|
||||
const ParameterWrapper *newValues, uint16_t startAtIndex) override;
|
||||
ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues,
|
||||
uint16_t startAtIndex) override;
|
||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||
LocalDataPoolManager& poolManager) override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user