7 years, 2 months ago.

static inline in gpio_object.h doesn't compile in uVision

I'm getting a couple of errors on the same line in gpio_object.h when I export to uVision.
mbed/KL25Z/gpio_object.h(33): warning: #260-D: explicit type is missing ("int" assumed)
mbed/KL25Z/gpio_object.h(33): error: #65: expected a ";"

Those lines look like this

http://mbed.org/users/mbed_official/code/mbed/file/b3110cd2dd17/KL25Z/gpio_object.h

static inline void gpio_write(gpio_t *obj, int value) {
    if (value)
        *obj->reg_set = obj->mask;
    else
        *obj->reg_clr = obj->mask;
}

The code looks fine to me... Does anyone have any suggestions to try? I've already tried adding braces to the if-else.

1 Answer

7 years, 2 months ago.

I think it was caused by a missing "--c99" compiler flag in the template for the KL25Z uVision project. This should be fixed now.

Accepted Answer