Skip to content

Commit

Permalink
Remove the dependency over embedded-runtimes.
Browse files Browse the repository at this point in the history
This build dependency won't work anymore with the next GNAT release as
runtimes will now require being installed into the compiler.

This commit also now generates automatically the board projects, to ease
the addition of new boards and runtimes, as well as taking into account
modifications refactoring of the library.
  • Loading branch information
lambourg authored and Fabien-Chouteau committed Jun 26, 2017
1 parent 2341eb5 commit 1ee78d5
Show file tree
Hide file tree
Showing 56 changed files with 639 additions and 400 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "embedded-runtimes"]
path = embedded-runtimes
url = https://github.com/AdaCore/embedded-runtimes.git
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
[![Build Status](https://travis-ci.org/AdaCore/Ada_Drivers_Library.svg?branch=master)](https://travis-ci.org/AdaCore/Ada_Drivers_Library)
[![Build status](https://ci.appveyor.com/api/projects/status/dvay075xkwxgppwm?svg=true)](https://ci.appveyor.com/project/AdaCore/ada-drivers-library)

## Warning!

This repository uses git submodule, please clone with the `--recursive` option:

```shell
git clone --recursive https://github.com/AdaCore/Ada_Drivers_Library.git
```

# 1. Introduction

This repository contains Ada source code and complete sample GNAT projects for
Expand All @@ -30,7 +22,6 @@ are available both for proprietary ("commercial") and non-proprietary use.

For details, see the `LICENSE` file in the root directory.


# 4. Requirements

The software is written in Ada 2012 and uses, for example, preconditions,
Expand All @@ -49,7 +40,6 @@ compiler for ARM ELF is one such compiler [(Download it
here)](http://libre.adacore.com/download/configurations). A recent GNAT Pro
compiler for that target will also suffice.


# 5. Content

Initial provision is for the hardware in the STM32F4 family of 32-bit MCUs, as
Expand Down
2 changes: 1 addition & 1 deletion arch/ARM/Nordic/nrf51.gpr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
with "config";
with "../../hal/HAL";
with "hal/HAL";
with "../cortex_m/cortex_m0";

library project nRF51 is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
with "../../../../../boards/common_config.gpr";
with "../../../../../boards/stm32f429_discovery.gpr";
with "../../../../../boards/stm32f429_discovery_full.gpr";

project Demo_L3GD20_Dataready_Int extends "../../../../../examples/shared/common/common.gpr" is

Expand All @@ -8,7 +8,7 @@ project Demo_L3GD20_Dataready_Int extends "../../../../../examples/shared/common
for Languages use ("Ada");
for Source_Dirs use ("src");
for Object_Dir use "obj/" & Common_Config.Build;
for Runtime ("Ada") use STM32F429_Discovery'Runtime("Ada");
for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada");
-- for Create_Missing_Dirs use "true";

package Builder is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
with "../../../../../boards/common_config.gpr";
with "../../../../../boards/stm32f429_discovery.gpr";
with "../../../../../boards/stm32f429_discovery_full.gpr";

project Demo_L3GD20_FIFO_Int extends "../../../../../examples/shared/common/common.gpr" is

for Main use ("demo_l3gd20.adb");
for Languages use ("Ada");
for Source_Dirs use ("src");
for Object_Dir use "obj/" & Common_Config.Build;
for Runtime ("Ada") use STM32F429_Discovery'Runtime("Ada");
for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada");
-- for Create_Missing_Dirs use "true";

package Builder is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
with "../../../../../boards/common_config.gpr";
with "../../../../../boards/stm32f429_discovery.gpr";
with "../../../../../boards/stm32f429_discovery_full.gpr";

project Demo_L3GD20 extends "../../../../../examples/shared/common/common.gpr" is

for Source_Dirs use ("src"); for Target use "arm-eabi";
for Main use ("demo_l3gd20.adb");
for Languages use ("Ada");
for Object_Dir use "obj/" & Common_Config.Build;
for Runtime ("Ada") use STM32F429_Discovery'Runtime("Ada");
for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada");
-- for Create_Missing_Dirs use "true";

package Builder is
Expand Down
2 changes: 1 addition & 1 deletion arch/ARM/STM32/stm32f40x.gpr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
with "config";
with "../../hal/HAL";
with "hal/HAL";
with "../cortex_m/cortex_m4f";

library project STM32F40x is
Expand Down
2 changes: 1 addition & 1 deletion arch/ARM/STM32/stm32f427x.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- directory.

with "config";
with "../../hal/HAL";
with "hal/HAL";
with "../cortex_m/cortex_m4f";

library project STM32F427x is
Expand Down
2 changes: 1 addition & 1 deletion arch/ARM/STM32/stm32f42x.gpr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
with "config";
with "../../hal/HAL";
with "hal/HAL";
with "../cortex_m/cortex_m4f";

library project STM32F42x is
Expand Down
4 changes: 2 additions & 2 deletions arch/ARM/STM32/stm32f46_79x.gpr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
with "config";
with "../../hal/HAL";
with "../../middleware/sdmmc";
with "hal/HAL";
with "middleware/sdmmc";
with "../cortex_m/cortex_m4f";

library project STM32F46_79x is
Expand Down
4 changes: 2 additions & 2 deletions arch/ARM/STM32/stm32f7x.gpr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
with "config";
with "../../hal/HAL";
with "../../middleware/sdmmc";
with "hal/HAL";
with "middleware/sdmmc";
with "../cortex_m/cortex_m7";

library project STM32F7x is
Expand Down
4 changes: 2 additions & 2 deletions arch/ARM/STM32/stm32f7x9.gpr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
with "config";
with "../../hal/HAL";
with "../../middleware/sdmmc";
with "hal/HAL";
with "middleware/sdmmc";
with "../cortex_m/cortex_m7";

library project STM32F7x9 is
Expand Down
2 changes: 1 addition & 1 deletion arch/ARM/cortex_m/cortex_m0.gpr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
with "config";
with "../../hal/HAL";
with "hal/HAL";

library project Cortex_M0 is

Expand Down
2 changes: 1 addition & 1 deletion arch/ARM/cortex_m/cortex_m4.gpr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
with "config";
with "../../hal/HAL";
with "hal/HAL";

library project Cortex_M4 is

Expand Down
2 changes: 1 addition & 1 deletion arch/ARM/cortex_m/cortex_m4f.gpr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
with "config";
with "../../hal/HAL";
with "hal/HAL";

library project Cortex_M4F is

Expand Down
2 changes: 1 addition & 1 deletion arch/ARM/cortex_m/cortex_m7.gpr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
with "config";
with "../../hal/HAL";
with "hal/HAL";

library project Cortex_M7 is

Expand Down
16 changes: 0 additions & 16 deletions boards/HiFive1/config.gpr

This file was deleted.

6 changes: 6 additions & 0 deletions boards/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
all:
for gpr in *.gpr; do \
echo Building $$gpr; \
gprbuild -q -j0 -XPLATFORM_BUILD=Debug -P $$gpr -p; \
gprbuild -q -j0 -XPLATFORM_BUILD=Production -P $$gpr -p; \
done
16 changes: 0 additions & 16 deletions boards/MicroBit/config.gpr

This file was deleted.

20 changes: 0 additions & 20 deletions boards/OpenMV2/config.gpr

This file was deleted.

8 changes: 6 additions & 2 deletions boards/common_config.gpr → boards/config.gpr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- This abstract project defines common scenario variables and switches used
-- all over the library.
abstract project Common_Config is
abstract project Config is

for Languages use ("Ada");
for Source_Dirs use ();
Expand All @@ -9,6 +9,9 @@ abstract project Common_Config is
("Debug", "Production");
Build : BUILD_Type := external ("PLATFORM_BUILD", "Debug");

RTS := external ("RTS_Profile", "ravenscar-sfp");
Object_Subdir := external ("Obj_Suffix", "");

-- Target architecture
Target := Project'Target;

Expand All @@ -21,6 +24,7 @@ abstract project Common_Config is
Callgraph_Switch := ("-fcallgraph-info=su");
end case;


package Compiler is
case Build is
when "Production" =>
Expand All @@ -38,4 +42,4 @@ abstract project Common_Config is
package Builder is
end Builder;

end Common_Config;
end Config;
30 changes: 15 additions & 15 deletions boards/crazyflie.gpr
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
aggregate library project Crazyflie is

Build := external ("BUILD", "Debug");
Board := "crazyflie";

type RTS_Type is ("ravenscar-sfp", "ravenscar-full");
RTS : RTS_Type := External ("RTS", "ravenscar-sfp");
type RTS_Profile_Type is ("ravenscar-sfp", "ravenscar-full");
RTS_Profile : RTS_Profile_Type :=
external ("RTS_Profile", "ravenscar-sfp");

type Build_Type is ("Debug", "Production");
Build : Build_Type := external ("PLATFORM_BUILD", "Production");

RTS_Base := Project'Project_Dir &
"../embedded-runtimes/ravenscar-stm32f407disco";
for Target use "arm-eabi";
for Runtime ("Ada") use RTS_Profile & "-stm32f4";

case RTS is
when "ravenscar-sfp" =>
for Runtime ("Ada") use RTS_Base & "/sfp";
when "ravenscar-full" =>
for Runtime ("Ada") use RTS_Base & "/full";
end case;
Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build;

for Project_Path use ("crazyflie");
for Library_Name use Board;
for Library_Dir use "lib/" & Obj_Suffix;

for external ("Obj_Suffix") use Obj_Suffix;
for external ("RTS_Profile") use RTS_Profile;
for Project_Path use
(Project'Project_Dir, Project'Project_Dir & "..");
for Project_Files use ("crazyflie/board.gpr");

for Library_Dir use "lib/crazyflie/" & RTS & "/" & Build;
for Library_Name use "crazyflie";

end Crazyflie;
20 changes: 0 additions & 20 deletions boards/crazyflie/config.gpr

This file was deleted.

23 changes: 14 additions & 9 deletions boards/crazyflie_full.gpr
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
aggregate library project Crazyflie_Full is

Build := external ("BUILD", "Debug");
for External ("RTS") use "ravenscar-full";
Board := "crazyflie";

RTS_Profile := "ravenscar-full";

type Build_Type is ("Debug", "Production");
Build : Build_Type := external ("PLATFORM_BUILD", "Production");

RTS_Base := Project'Project_Dir &
"../embedded-runtimes/ravenscar-stm32f407disco";
for Target use "arm-eabi";
for Runtime ("Ada") use RTS_Profile & "-stm32f4";

for Runtime ("Ada") use RTS_Base & "/full";
Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build;

for Project_Path use ("crazyflie");
for Library_Name use Board;
for Library_Dir use "lib/" & Obj_Suffix;

for external ("Obj_Suffix") use Obj_Suffix;
for external ("RTS_Profile") use RTS_Profile;
for Project_Path use
(Project'Project_Dir, Project'Project_Dir & "..");
for Project_Files use ("crazyflie/board.gpr");

for Library_Dir use "lib/crazyflie/ravenscar-full/" & Build;
for Library_Name use "crazyflie";

end Crazyflie_Full;
24 changes: 24 additions & 0 deletions boards/crazyflie_sfp.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
aggregate library project Crazyflie_SFP is

Board := "crazyflie";

RTS_Profile := "ravenscar-sfp";

type Build_Type is ("Debug", "Production");
Build : Build_Type := external ("PLATFORM_BUILD", "Production");

for Target use "arm-eabi";
for Runtime ("Ada") use RTS_Profile & "-stm32f4";

Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build;

for Library_Name use Board;
for Library_Dir use "lib/" & Obj_Suffix;

for external ("Obj_Suffix") use Obj_Suffix;
for external ("RTS_Profile") use RTS_Profile;
for Project_Path use
(Project'Project_Dir, Project'Project_Dir & "..");
for Project_Files use ("crazyflie/board.gpr");

end Crazyflie_SFP;
Loading

0 comments on commit 1ee78d5

Please sign in to comment.