/* Function for restore tail state entry action. 
Function for restore tail state entry action, which includes writing the tail section back from swap to the data page.  */
static void state_restore_tail_entry_run(void)
/* Function for restore tail state entry action. 
Function for restore tail state entry action, which includes writing the tail section back from swap to the data page.  */
static void state_restore_tail_entry_run(void)
{
    const cmd_queue_element_t * p_cmd        = &m_cmd_queue.cmd[m_cmd_queue.rp];    
    const pstorage_block_t      cmd_block_id = p_cmd->storage_addr.block_id;                            
    const uint32_t tail_offset = (cmd_block_id + p_cmd->size + p_cmd->offset) % 
                                 PSTORAGE_FLASH_PAGE_SIZE; 
    flash_write((uint32_t *)(cmd_block_id + p_cmd->size + p_cmd->offset),
                (uint32_t *)(PSTORAGE_SWAP_ADDR + tail_offset),
                m_tail_word_size);
}