

If I remember correctly in XC8 the enum type is implemented with a char (8 bit) type, unless the number of states or explicit assignments of values forces the compiler to use larger data types. For the rest, Since you mention C89 i assume you are using XC8. There is also the case of a peripheral which requires a specific sequence of operations, like first you have to set one bit, then you can set the registers and so on. If i can spare a few cycles during initialization i can just set each bit(s) individually and comment with what am i setting. Since i don't like typing lots and lots and lots of defines and macros and multiline statements my usual approach is to write the register value directly and comment the settings.

#MPLAB XC8 TYPEDEF BIT SOFTWARE#
* Software FIFO buffer size */ #define FIFO_BUFFER_SIZE (2100u) /* Software FIFO buffer type */ typedef struct /* getByte() */ /*- Function : processGeneralMessage Purpose : Process general incoming messages from console system.I think the most common approach to your main problem (using keywords instead of register bits) is to use a set of defines, or at least it's how i always saw it implemented in any mcu i worked with. Nyquist sıklık sınırlarını neden kullanıyoruz |
