PSAS/ PicCore/ conventions

PicCore Coding Conventions

Here are some thoughts from your friendly neighborhood PicCore programmer.

Things that actually matter:

Things that don't matter as much but I'll whine at you if you don't pay attention:

It's nice to see consitent-looking code, especially when you have to look at a lot of it. With that in mind, we've tried to be pretty consistent about how code looks:

/--------------------------------------------------------------------------- | Function: get_battery_state | | Purpose: Sample battery voltage, make some kind of state-of-charge | determination even though voltage sucks for that kind of thing. | | Discussion: We need to get the state of the battery - charged, discharged, | etc - but we don't have a charge count (or even a current | meter!) so we'll use the battery voltage as a terribly rough | state of charge meter. | | Expects: to be called at least once a minute. | | Date | Notes |------------|------------------------------------------------------------ | 02/24/2004 | Created. ---------------------------------------------------------------------------/

void function (void) { if (condition) { if (condition) { statements; } } else if (condition) { statements; } }