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

problem with FUNC

I always get an error 129 (missing ';' before 'void') when I compile in this part:
func void iicstart (void)
{
sda = 1;
scl = 1;
del4us ()
sda = 0;
del4us ()
scl = 0;
del4us ()
}

what is wrong?

Parents
  • On second look, it appears you have debugger functions confused with C functions.

    When writing your C program, you must use ANSI C rules. And, func is not a part of that rule set.

    If your function is intended to be used in your program, you should modify it as follows:

    void iicstart (void)
    {
    sda = 1;
    scl = 1;
    del4us ();
    sda = 0;
    del4us ();
    scl = 0;
    del4us ();
    }

    If, on the other hand, the function is intended to be used in the debugger (to simulate the input of an I2C input signal) you should modify it as follows:

    func void iicstart (void) {
    sda = 1;
    scl = 1;
    del4us ();
    sda = 0;
    del4us ();
    scl = 0;
    del4us ();
    }

    Jon

Reply
  • On second look, it appears you have debugger functions confused with C functions.

    When writing your C program, you must use ANSI C rules. And, func is not a part of that rule set.

    If your function is intended to be used in your program, you should modify it as follows:

    void iicstart (void)
    {
    sda = 1;
    scl = 1;
    del4us ();
    sda = 0;
    del4us ();
    scl = 0;
    del4us ();
    }

    If, on the other hand, the function is intended to be used in the debugger (to simulate the input of an I2C input signal) you should modify it as follows:

    func void iicstart (void) {
    sda = 1;
    scl = 1;
    del4us ();
    sda = 0;
    del4us ();
    scl = 0;
    del4us ();
    }

    Jon

Children
No data