Working logger implementation and some fixes for driver code

This commit is contained in:
dario
2024-06-15 12:42:11 +02:00
parent 789fa4cd3e
commit 231f2ea06d
4 changed files with 123 additions and 115 deletions

View File

@@ -86,32 +86,6 @@ namespace sta
*/
bool isBusy();
uint32_t getChunkBytes(ChunkSize size);
/**
* @brief
*
* @note
*
* @param criterion
* @param size
* @return uint32_t
*/
/**
* @brief Find the first memory section not satisfying a given criterion using a binary search.
*
* @note This function assumes that there is a page n such that every page before n satisfies the criterion, while every page after that doesn't.
*
* @param criterion A function evaluating the criterion on a page.
* @param size The size of the memory section. Has to be one of the predefined sizes.
* @param startAddr The start address of the segment to search. Defaults to the chip's start address.
* @param endAddr The end address of the segment to search. Defaults to the chip's end address.
* @return uint32_t The last address such that the criterion is satisfied.
*/
uint32_t findLast(std::function<bool(uint8_t*)> criterion, ChunkSize size, uint32_t startAddr = 0, uint32_t endAddr = W25QXX_32B_MEM_SIZE);
/**
* @brief Set the Address Mode object
*
@@ -212,7 +186,7 @@ namespace sta
* @param address The number of the sector to erase. Here, 0 is the first sector, 1 the second and so on.
* @return bool Returns 1 if the operation was successful, 0 otherwise.
*/
uint8_t sectorErase(uint32_t address);
uint8_t sectorErase(uint32_t address, bool blocking = false);
/**
* @brief Sets all memory within a specified block (32/64 KByte) to 1s.