* Make a distinct library for every chip. This could make user code portable across chips.

This commit is contained in:
Vovanium 2021-07-20 19:36:51 +03:00
parent c4de546006
commit 9b6a1abd1e
10 changed files with 50 additions and 14 deletions

View file

@ -1,4 +1,5 @@
with "../../stm32_library.gpr";
with "../../stm32f407z_library.gpr";
project LED_Flasher is
for Languages use("Ada");
for Main use("led_flasher.adb");

View file

@ -1,4 +1,5 @@
with "../../stm32_library.gpr";
with "../../stm32f429z_library.gpr";
project LED_Flasher_429disco is
for Languages use("Ada");
for Main use("led_flasher_429disco.adb");

View file

@ -1,5 +1,5 @@
with STM32.F407Z; use STM32.F407Z;
use STM32.F407Z.Modules.GPIO;
with STM32.Hardware; use STM32.Hardware;
use STM32.Hardware.Modules.GPIO;
with STM32.F4.GPIO.Ports; use STM32.F4.GPIO.Ports;
with Ada.Real_Time; use Ada.Real_Time;

View file

@ -1,5 +1,5 @@
with STM32.F429Z; use STM32.F429Z;
use STM32.F429Z.Modules.GPIO;
with STM32.Hardware; use STM32.Hardware;
use STM32.Hardware.Modules.GPIO;
with STM32.F4.GPIO.Ports; use STM32.F4.GPIO.Ports;
with Ada.Real_Time; use Ada.Real_Time;

View file

@ -1,6 +1,6 @@
with STM32.F429Z; use STM32.F429Z;
use STM32.F429Z.Modules.GPIO;
use STM32.F429Z.Modules.USART;
with STM32.Hardware; use STM32.Hardware;
use STM32.Hardware.Modules.GPIO;
use STM32.Hardware.Modules.USART;
with Ada.Real_Time; use Ada.Real_Time;

View file

@ -1,4 +1,5 @@
with "../../stm32_library.gpr";
with "../../stm32f429z_library.gpr";
project UART_429disco is
for Languages use("Ada");
for Main use("uart_429disco.adb");

View file

@ -7,7 +7,7 @@ with STM32.F4.SYSCFG;
with STM32.F4.USART;
with STM32.F4.Address_Map;
package STM32.F407Z is
package STM32.Hardware is
pragma Preelaborate;
package Address_Map renames STM32.F4.Address_Map;
@ -79,4 +79,4 @@ package STM32.F407Z is
--pragma Warnings (On, "* may call Last_Chance_Handler");
--pragma Warnings (On, "* may be incompatible with alignment of object");
end STM32.F407Z;
end STM32.Hardware;

View file

@ -7,7 +7,7 @@ with STM32.F4.SYSCFG;
with STM32.F4.USART;
with STM32.F4.Address_Map;
package STM32.F429Z is
package STM32.Hardware is
pragma Preelaborate;
package Address_Map renames STM32.F4.Address_Map;
@ -90,4 +90,4 @@ package STM32.F429Z is
UART8: Modules.USART.USART_Registers
with Volatile, Import, Address => System'To_Address(Address_Map.UART8);
end STM32.F429Z;
end STM32.Hardware;

16
stm32f407z_library.gpr Normal file
View file

@ -0,0 +1,16 @@
project STM32F407Z_Library is
for Source_Dirs use ("source", "source/f4", "source/f4/07z");
for Object_Dir use "objects/f407z";
for Library_Dir use "library/f407z";
for Library_Name use "stm32f407z";
for Library_Kind use "static";
for Target use "arm-elf";
for Runtime("ada") use "zfp-stm32f4";
package Builder is
for Default_Switches("Ada") use (
"-gnato",
"-O2",
"-gnatW8"
);
end Builder;
end STM32F407Z_Library;

17
stm32f429z_library.gpr Normal file
View file

@ -0,0 +1,17 @@
project STM32F429Z_Library is
for Source_Dirs use ("source", "source/f4", "source/f4/29z");
for Object_Dir use "objects/f429z";
for Library_Dir use "library/f429z";
for Library_Name use "stm32f429z";
for Library_Kind use "static";
--for Library_Interface use ("STM32", "STM32.STM32F429Z");
for Target use "arm-elf";
for Runtime("ada") use "zfp-stm32f4";
package Builder is
for Default_Switches("Ada") use (
"-gnato",
"-O2",
"-gnatW8"
);
end Builder;
end STM32F429Z_Library;