FAQ's
  • I want to use a pointer to cast odd number address data to int type or long type data and read them, but I cannot do that successfully. How can I address this problem?
    • To cast odd number address data to int type or long type data and read them, specify a __packed modifier.
      This generates a code to be accessed in bytes whether or not the address is an odd or even number.
      An example is shown below.
      unsigned char ucbuf[8] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88};
      unsigned int ui;
      ...
      void func(void)
      {
      ui = *(__packed unsigned int*)&ucbuf[3]; // ucbuf[3] and ucbuf[4] data are read to store 0x5544 in ui
      }

      For the __packed modifier, refer to "11.1 How To Use __packed and __unpacked Modifiers" in "CCU8 User's Manual".

      Related Products: ML610(Q)40x, ML610(Q)42x, ML610(Q)47x, ML610(Q)48x, ML610Q10x, ML610Q11x, ML610Q17x, ML610Q30x, ML610Q35x, ML610Q36x, ML610Q38x, ML610Q41x, ML610Q43x, ML610Q46x, ML620Q13x, ML620Q15x, ML620Q416/ML620Q418, ML620Q503H/ML620Q504H/ML620Q506H, ML62Q12xx, ML62Q13xx, ML62Q14xx, ML62Q15xx/ML62Q18xx, ML62Q16xx, ML62Q17xx

    • Products: General-purpose MCUs (16bit) , Speech Playback MCUs (8bit)