MCPcopy Create free account
hub / github.com/andysworkshop/stm32plus / checkFlush

Method checkFlush

lib/src/device/BlockDeviceOutputStream.cpp:99–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 */
98
99 bool BlockDeviceOutputStream::checkFlush() {
100
101 if(!_buffered || _indexInBlock==_device.getBlockSizeInBytes()) {
102
103 // user wants us to flush, or we've run out of space in the block
104
105 if(!_device.writeBlock(_block,_blockIndex))
106 return false;
107
108 // if run out of space, increment block and reset pointer
109
110 if(_indexInBlock==_device.getBlockSizeInBytes()) {
111 _blockIndex++;
112 _indexInBlock=0;
113 }
114 }
115
116 return true;
117 }
118
119
120 /**

Callers

nothing calls this directly

Calls 2

getBlockSizeInBytesMethod · 0.45
writeBlockMethod · 0.45

Tested by

no test coverage detected