Creating a new GCC C Static library Project:
----------------------------------------------------------------------
- Click on “Atmel Studio -> File -> New -> Project… -> GCC C Static Library Project” to create a new Library project
- Select the target device to proceed
- You can make your own library functions in this project
- When you build the project, the library file (“xxxx.a”) gets created inside the ‘debug’ folder.
This library file (.a) can be later linked to the application project
Linking the library file with any other application project:
-----------------------------------------------------------------------------------------------
- Create a new application project in Atmel Studio (File -> New -> Project) (or) Open an existing application project.
- Navigate to Solution Explorer Window.
- Right click on the project name and select ‘Add Library’
- Select ‘Browse Libraries’ on the left side pane.
- Click on ‘Browse’ button
- Navigate to the ‘previously created library project -> Debug folder’
- Select the library file ‘xxxx.a’
Now you should be able to use the library functions in the application project.
Nhận xét