This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LM3S1608

Hello,

new compiler V5.05 does not handle an expression:
lastrec[2] = (kol_strok / 4); //

and so works:
lastrec[2] = kol_strok / 4; //

Parents
  • Thanks, Ralf.
    It was some kind of magic, because this is a very simple script, not to work. But it was ...
    to your questions:
    1. I use last uvision 5.15 and default compiler (armcc.exe V5.05 update 2 (build 169)).
    2. variables and code below:
    unsigned char lastrec[4];
    U16 resint;

    resint = 0xDE; // or 222

    lastrec[2] = (resint / 4); // lastrec[2] == 0x37 or 55

    lastrec[3] = (resint - (lastrec[2] * 4)) + 1; // 222 - (55 * 4) +1 == 3

    lastrec[3] *= 0x40; // 3 * 0x40 = 0xC0

    lastrec[2] += 0xC0; // 0x37 + 0xC0 = 0xF7

    __nop();

    3. no errors and messages.

    Thank you and best regards,
    Sergey

Reply
  • Thanks, Ralf.
    It was some kind of magic, because this is a very simple script, not to work. But it was ...
    to your questions:
    1. I use last uvision 5.15 and default compiler (armcc.exe V5.05 update 2 (build 169)).
    2. variables and code below:
    unsigned char lastrec[4];
    U16 resint;

    resint = 0xDE; // or 222

    lastrec[2] = (resint / 4); // lastrec[2] == 0x37 or 55

    lastrec[3] = (resint - (lastrec[2] * 4)) + 1; // 222 - (55 * 4) +1 == 3

    lastrec[3] *= 0x40; // 3 * 0x40 = 0xC0

    lastrec[2] += 0xC0; // 0x37 + 0xC0 = 0xF7

    __nop();

    3. no errors and messages.

    Thank you and best regards,
    Sergey

Children