|
35 | 35 | static constexpr uint32_t kFlashSectorSize = 4096U; |
36 | 36 | static constexpr uint32_t kBsramSize = 4096U; |
37 | 37 |
|
38 | | -StoreDevice::StoreDevice() { |
39 | | - DEBUG_ENTRY |
| 38 | +StoreDevice::StoreDevice() |
| 39 | +{ |
| 40 | + DEBUG_ENTRY |
40 | 41 |
|
41 | | - detected_ = true; |
| 42 | + detected_ = true; |
42 | 43 |
|
43 | | - printf("StoreDevice: BSRAM with total %d bytes [%d kB]\n", GetSize(), GetSize() / 1024U); |
44 | | - DEBUG_EXIT |
| 44 | + printf("StoreDevice: BSRAM with total %d bytes [%d kB]\n", GetSize(), GetSize() / 1024U); |
| 45 | + DEBUG_EXIT |
45 | 46 | } |
46 | 47 |
|
47 | | -StoreDevice::~StoreDevice() { |
48 | | - DEBUG_ENTRY |
| 48 | +StoreDevice::~StoreDevice(){DEBUG_ENTRY |
49 | 49 |
|
50 | | - DEBUG_EXIT |
51 | | -} |
| 50 | + DEBUG_EXIT} |
52 | 51 |
|
53 | | -uint32_t StoreDevice::GetSize() const { |
54 | | - return kBsramSize; |
| 52 | +uint32_t StoreDevice::GetSize() const |
| 53 | +{ |
| 54 | + return kBsramSize; |
55 | 55 | } |
56 | 56 |
|
57 | | -uint32_t StoreDevice::GetSectorSize() const { |
58 | | - return kFlashSectorSize; |
| 57 | +uint32_t StoreDevice::GetSectorSize() const |
| 58 | +{ |
| 59 | + return kFlashSectorSize; |
59 | 60 | } |
60 | 61 |
|
61 | | -bool StoreDevice::Read(__attribute__((unused)) uint32_t offset, __attribute__((unused)) uint32_t length, __attribute__((unused)) uint8_t *buffer, storedevice::Result& result) { |
62 | | - DEBUG_ENTRY |
63 | | - DEBUG_PRINTF("offset=%p[%d], len=%u[%d], data=%p[%d]", offset, (((uint32_t)(offset) & 0x3) == 0), length, (((uint32_t)(length) & 0x3) == 0), buffer, (((uint32_t)(buffer) & 0x3) == 0)); |
64 | | - assert((offset + length) <= BSRAM_SIZE); |
| 62 | +bool StoreDevice::Read(__attribute__((unused)) uint32_t offset, __attribute__((unused)) uint32_t length, __attribute__((unused)) uint8_t* buffer, storedevice::Result& result) |
| 63 | +{ |
| 64 | + DEBUG_ENTRY |
| 65 | + DEBUG_PRINTF("offset=%p[%d], len=%u[%d], data=%p[%d]", offset, (((uint32_t)(offset) & 0x3) == 0), length, (((uint32_t)(length) & 0x3) == 0), buffer, (((uint32_t)(buffer) & 0x3) == 0)); |
| 66 | + assert((offset + length) <= BSRAM_SIZE); |
65 | 67 |
|
66 | | - result = storedevice::Result::OK; |
| 68 | + result = storedevice::Result::kOk; |
67 | 69 |
|
68 | | - DEBUG_EXIT |
69 | | - return true; |
| 70 | + DEBUG_EXIT |
| 71 | + return true; |
70 | 72 | } |
71 | 73 |
|
72 | | -bool StoreDevice::Erase(__attribute__((unused)) uint32_t offset, __attribute__((unused)) uint32_t length, storedevice::Result& result) { |
73 | | - DEBUG_ENTRY |
| 74 | +bool StoreDevice::Erase(__attribute__((unused)) uint32_t offset, __attribute__((unused)) uint32_t length, storedevice::Result& result) |
| 75 | +{ |
| 76 | + DEBUG_ENTRY |
74 | 77 |
|
75 | | - result = storedevice::Result::OK; |
| 78 | + result = storedevice::Result::kOk; |
76 | 79 |
|
77 | | - DEBUG_EXIT |
78 | | - return true; |
| 80 | + DEBUG_EXIT |
| 81 | + return true; |
79 | 82 | } |
80 | 83 |
|
81 | | -bool StoreDevice::Write(__attribute__((unused)) uint32_t offset, __attribute__((unused)) uint32_t length, __attribute__((unused)) const uint8_t *buffer, storedevice::Result& result) { |
82 | | - DEBUG_ENTRY |
83 | | - DEBUG_PRINTF("offset=%p[%d], len=%u[%d], data=%p[%d]", offset, (((uint32_t)(offset) & 0x3) == 0), length, (((uint32_t)(length) & 0x3) == 0), buffer, (((uint32_t)(buffer) & 0x3) == 0)); |
84 | | - assert((offset + length) <= BSRAM_SIZE); |
| 84 | +bool StoreDevice::Write(__attribute__((unused)) uint32_t offset, __attribute__((unused)) uint32_t length, __attribute__((unused)) const uint8_t* buffer, storedevice::Result& result) |
| 85 | +{ |
| 86 | + DEBUG_ENTRY |
| 87 | + DEBUG_PRINTF("offset=%p[%d], len=%u[%d], data=%p[%d]", offset, (((uint32_t)(offset) & 0x3) == 0), length, (((uint32_t)(length) & 0x3) == 0), buffer, (((uint32_t)(buffer) & 0x3) == 0)); |
| 88 | + assert((offset + length) <= BSRAM_SIZE); |
85 | 89 |
|
86 | | - result = storedevice::Result::OK; |
| 90 | + result = storedevice::Result::kOk; |
87 | 91 |
|
88 | | - DEBUG_EXIT |
89 | | - return true; |
| 92 | + DEBUG_EXIT |
| 93 | + return true; |
90 | 94 | } |
0 commit comments