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

non-executable code (invalid break points)

The following codes are for initializing the LCD display and directly copied from my program, but when those codes under debugging using software simulator, why the line 6 & line 12 always are non-executable code (invalid break points)? What are the possible reasons?

void DispInit ( unsigned char maxrows, unsigned char maxcols)
{
1. DispInitPort();
2. DispMaxRows = maxrows;
3. DispMaxCols = maxcols;
4. OS_Delay(100);
5. DispSel(DISP_SEL_CMD_REG);
6. DispDataWr(0x30);
7. OS_Delay (2);

8. DispSel(DISP_SEL_CMD_REG);
9. DispDataWr(0x30);
10. OS_Delay(150);


11. DispSel(DISP_SEL_CMD_REG);
12. DispDataWr(0x30);
13. OS_Delay(2);
14. DispSel(DISP_SEL_CMD_REG);
15. DispDataWr(0x08);
16. OS_Delay(2);
17. DispSel(DISP_SEL_CMD_REG);
18. DispDataWr(0x08);
19. OS_Delay(2);
}

Please help me, it is time consuming & really killing

Parents
  • Thank you Walt Conley and Andy Neil .
    You are absolutely right. After I have changed the function DispDataWr
    from:
    static void DispDataWr(unsigned char val)
    to:
    static void DispDataWr(volatile unsigned char val),
    problems seem have been resolved.

    By the way the optimization setting I am using is level 8 ( reuse common entry code).

Reply
  • Thank you Walt Conley and Andy Neil .
    You are absolutely right. After I have changed the function DispDataWr
    from:
    static void DispDataWr(unsigned char val)
    to:
    static void DispDataWr(volatile unsigned char val),
    problems seem have been resolved.

    By the way the optimization setting I am using is level 8 ( reuse common entry code).

Children
No data