Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4928

Anyone here using C to compose 'object-based' Microcontroller programmes?

$
0
0
It's related to but much simpler than 'object-oriented' programme composition. I attempt it (for a mid-range PIC application) by having each .c source file in my project hold only the variable(s) and functions needed for a single purpose (e.g. PowerManager.c, BatteryMonitor.c, Timebase.c) and strive to maximise 'encapsulation' by using C scoping qualifiers to 'hide' everything but the functions which must be accessible from other C source files.

I find this approach's clarity of purpose...

Anyone here using C to compose 'object-based' Microcontroller programmes?

Viewing all articles
Browse latest Browse all 4928

Trending Articles