all cstdout uses wrapped in preprocessor defines
This commit is contained in:
@ -26,12 +26,16 @@ StorageAccessor::StorageAccessor(StorageAccessor&& other):
|
||||
|
||||
ReturnValue_t StorageAccessor::getDataCopy(uint8_t *pointer, size_t maxSize) {
|
||||
if(internalState == AccessState::UNINIT) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << "StorageAccessor: Not initialized!" << std::endl;
|
||||
#endif
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
if(size_ > maxSize) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "StorageAccessor: Supplied buffer not large "
|
||||
"enough" << std::endl;
|
||||
#endif
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
std::copy(dataPointer, dataPointer + size_, pointer);
|
||||
@ -40,7 +44,9 @@ ReturnValue_t StorageAccessor::getDataCopy(uint8_t *pointer, size_t maxSize) {
|
||||
|
||||
uint8_t* StorageAccessor::data() {
|
||||
if(internalState == AccessState::UNINIT) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << "StorageAccessor: Not initialized!" << std::endl;
|
||||
#endif
|
||||
}
|
||||
return dataPointer;
|
||||
}
|
||||
@ -48,12 +54,16 @@ uint8_t* StorageAccessor::data() {
|
||||
ReturnValue_t StorageAccessor::write(uint8_t *data, size_t size,
|
||||
uint16_t offset) {
|
||||
if(internalState == AccessState::UNINIT) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << "StorageAccessor: Not initialized!" << std::endl;
|
||||
#endif
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
if(offset + size > size_) {
|
||||
#if CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "StorageAccessor: Data too large for pool "
|
||||
"entry!" << std::endl;
|
||||
#endif
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
std::copy(data, data + size, dataPointer + offset);
|
||||
|
Reference in New Issue
Block a user