hello, Please forgive me if I am asking a stupid question.
I was editing S130 demo app and I included pstorage.c file to the project. while compiling it is showing error saying "declaration may not appear after executable statement in block".
void pstorage_sys_event_handler(uint32_t sys_evt)
{
uint32_t retval = NRF_SUCCESS;
if (m_cmd_queue.flash_access == true)
{
...............................
...............................
switch (sys_evt)
{
case NRF_EVT_FLASH_OPERATION_SUCCESS:
{
.......
const bool store_finished =
((p_cmd->op_code == PSTORAGE_STORE_OP_CODE) &&
((m_round_val * SOC_MAX_WRITE_SIZE) >= p_cmd->size)); /* Here i am getting error*/
const bool update_finished =
((p_cmd->op_code == PSTORAGE_UPDATE_OP_CODE) &&
(m_swap_state == STATE_COMPLETE));
const bool clear_block_finished =
((p_cmd->op_code == PSTORAGE_CLEAR_OP_CODE) &&
(m_swap_state == STATE_COMPLETE));
...........
...........
The declaration of const bool variable is done after some executable part. How it is possible in C? I got the same error for some other source files also. The pgm works fine for S110. Then what could be the possible problem with S130??
Thanks in advance.