FSM Lecture 68: Exercise-007 Adding free operations

 

Exercise-007 Adding free operations

 

 

Adding free operations

The free operations you can either create from here. Right-click on the package and Add operation; you already know that.  Or what you can do is speed up the process? Copy all the functions, and you have to add that in ClockAlarm_SM.cpp. 

Go to ClockAlarm_SM.cpp and make it external (shown in Figure 1). And generate the code.

Adding free operations
Figure 1. ClockAlarm_SM.cpp file

 

You can paste all those codes after the marks, as shown in Figure 2. You should not edit any code which is in between “vvv” this marker and “^^^” this marker; please keep that in mind. 

Adding free operations
Figure 2. Write the code in between these markers

 

You can edit the code which is outside this(^^^) marker. I’m going to paste all that code after that marker. 

And now you can even add the prototype at the beginning, you can Add, as shown in Figure 3. So, you can add any code after this marker. Here I’ll paste the prototypes like that.

Adding free operations
Figure 3. Prototypes of helper functions

 

You can copy-paste like this. In the following article, we will test this on the LCD. 

 

FastBit Embedded Brain Academy Courses

Click here: https://fastbitlab.com/course1

 

FastBitLab

The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.