Thanks for finding this.
That is indeed the problem. When I change the #define to something like
F_FAIL then I get the expected result in app.c.
I don't understand why other things don't blow up because FAIL is part of an
enum in TinyError.h
enum {
SUCCESS = 0,
FAIL = 1, // Generic condition: backwards compatible
ESIZE = 2, // Parameter passed in was too big.
ECANCEL = 3, // Operation cancelled by a call.
EOFF = 4, // Subsystem is not active
EBUSY = 5, // The underlying system is busy; retry
later
EINVAL = 6, // An invalid parameter was passed
ERETRY = 7, // A rare and transient failure: can retry
ERESERVE = 8, // Reservation required before usage
EALREADY = 9, // The device state you are requesting is
already set
ENOMEM = 10, // Memory required not available
ENOACK = 11, // A packet was not acknowledged
ELAST = 11 // Last enum value
};
So I would expect the definition of FAIL to then become
1 = 1, which should blow up with a syntax error.
So I definitely know that the culprit is flash.h because when I modify FAIL
in flash.h the problem goes away.
I also know that flash.h isn't getting included until sometime after the
other uses of FAIL have already been added to app.c.
That is why the enum definition works.
flash.h gets included by the cpu include. What I don't understand is why it
doesn't hit the whole of app.c. Why does it
hit my file and not the other places?
eric
On Mon, Apr 26, 2010 at 9:29 AM, Greg Hackmann <[email protected]> wrote:
> On 4/26/10 6:28 AM, Michiel Konstapel wrote:
> > Now that is interesting - I've recently noticed the same thing myself.
> > Is something redefining FAIL, somewhere?
>
> Out of curiosity, I grepped for FAIL in my copy of the MSP430 libc.
> Something interesting popped up in include/msp430/flash.h:
>
> #define FAIL 0x0080 /* Last Program or Erase failed */
>
> If a module in your app #included this file (either directly, or by
> #including another header in the MSP430 libc that in turn #included
> flash.h), it would completely explain the problem you're seeing.
>
> Greg Hackmann
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
--
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help