March 2016
Beginner to intermediate
296 pages
6h 34m
English
This recipe illustrates a version of addTwoNums that uses the machine storage classes, int32_t and uint8_t. We explain why it is advantageous for embedded applications to define and use these as opposed to the primitive types that are provided by the C language.
To define and use machine storage classes, please follow the outlined steps:
addTwoNums_v2 by cloning the previous project.addTwoNums.c file from the previous recipe to the folder and modify it as follows:int main (void) { int32_t input; uint8_t num1, num2, res; HAL_Init (); /* Init Hardware Abstraction Layer */ SystemClock_Config (); /* Config Clocks */ SER_Init(); for (;;) { /* Loop forever */ printf("Enter ...Read now
Unlock full access