I log records in external memory. Every record takes \$2\$ bytes. Now I need to read \$N\$ last records in chunks of \$18\$ bytes, so I did something like this.uint32_t chank = 18;  //DELTA_SIZE * AVAILABLE_BUF_SIZE;uint32_t last_log_addr = (logNum * DELTA_SIZE) + START_LOG_ADRESS;uint32_t packet_size;uint32_t current_addr = last_log_addr;  //check if the overflow occurredwhile (current_addr > START_LOG_ADRESS){    packet_size = chank;    uint8_t buf[packet_size];    LOGGER_Readlog(current_addr,packet_size,buf);    SendBuf(buf);    current_addr -= chank; }// send the rest of data ???However, I think the algorithm and subsequent code can be improved.
Read Log from external memory
c