简体   繁体   中英

Description Resource Path Location Type invalid type argument of unary '*' (have 'uint32_t {aka long unsigned int}')

Why do I get this error on sum = line? Not sure what is wrong... mem_ptr is declared as pointer...

uint32_t MCU_ReadMemTest(uint32_t start_addr, uint32_t end_addr)
    {
          uint32_t mem_ptr = (uint32_t*)start_addr;
          uint32_t stop_ptr = (uint32_t*)end_addr;

          while (mem_ptr != stop_ptr)
          {
              sum = (*mem_ptr);
              mem_ptr++;
              cnt++;
          }

          return retval;
    }

Thanks, R.

Thanks for help,

have changed the code and now it is ok...

uint32_t MCU_ReadMemTest(uint32_t start_addr, uint32_t end_addr)
{
      uint32_t retval, startt, endt, cnt=0,sum=0;
      uint32_t *mem_ptr = start_addr;
      uint32_t *stop_ptr = end_addr;
...

Thanks, R.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM