LibSpindle-C-Library 1.0
Library Code documentation
Loading...
Searching...
No Matches
Library porting

Introduction

The library is written with a minimum set of compiler dependencies to make it portable on most toolchains and most compilers which are able to compile C. There are no GCC attributes or MSVC pragmas included in the code furthermore there are no weak functions or other non ISO-C language keywords which are not parsable from all compilers. To include the library in a project, the following page helps to do the job and can be used as a step by step quick porting guide.

required steps to include the library

  1. include all include paths of the library folder (inc-folder) to your project or copy them into your project as needed
  2. link all C files (src-folder) to your project or copy them to your project as needed
  3. adapt your makefile in case you have one. When using eclipse project this is not required
  4. compile the source code once to make sure everything builds without issues and your include paths are correct.
  5. now implement the platform functions which are required be the SpindlePhysicalParams_t structure when calling SPINDLE_CreateInstance.
  6. when all functions are defined, no error should be returned after the call of SPINDLE_CreateInstance. Porting is done.

note

when porting the platform functions, it is not required to execute anything in the SpindlePhysicalParams_t[setDirection] function, because the setDutyCycle function and the enaPWM function is called directly after the setDirection function. So it is sufficient to only store a variable value anywhere and interpret it later in the setDutyCyle function!