├── microbit ├── .gitignore ├── ada_source_path ├── adalib │ └── .keep_adalib ├── COPYING.FreeRTOS ├── COPYING.MIT ├── adainclude │ ├── startup.ads │ ├── nrf51_clock.ads │ └── startup-set_up_clock.adb ├── README.md ├── runtime.xml ├── Makefile └── COPYING.Nordic ├── arduino-due ├── .gitignore ├── ada_source_path ├── adalib │ └── .keep_adalib ├── COPYING.FreeRTOS ├── README ├── COPYING.MIT ├── runtime.xml ├── adainclude │ └── startup.ads ├── Makefile └── COPYING.Atmel ├── stm32f4 ├── .gitignore ├── ada_source_path ├── adalib │ └── .keep_adalib ├── COPYING.FreeRTOS ├── COPYING.MIT ├── README.md ├── adainclude │ └── startup.ads ├── runtime.xml └── Makefile ├── stm32f429i ├── .gitignore ├── ada_source_path ├── adalib │ └── .keep_adalib ├── README.md ├── COPYING.FreeRTOS ├── COPYING.MIT ├── adainclude │ └── startup.ads ├── runtime.xml └── Makefile ├── common ├── .gitignore ├── gnat-ce-2020 │ ├── .gitignore │ └── s-secsta.adb ├── README ├── os_exit.ads ├── os_exit.adb ├── adaint.c ├── a-charac.ads ├── ada.ads ├── machcode.ads ├── math │ ├── a-nurear.ads │ ├── a-nucoty.ads │ ├── a-nlrear.ads │ ├── a-nlcoty.ads │ ├── a-nscoty.ads │ ├── a-nllrar.ads │ ├── a-nllcty.ads │ ├── a-nuelfu.ads │ ├── a-nlelfu.ads │ ├── a-nselfu.ads │ ├── a-nllefu.ads │ ├── a-nucoar.ads │ ├── a-nlcoar.ads │ ├── a-ncelfu.ads │ ├── a-nlcefu.ads │ ├── a-nscefu.ads │ ├── a-nllcef.ads │ ├── a-nllcar.ads │ └── a-numeri.ads ├── post-gcc12 │ ├── a-contai.ads │ ├── a-cgarso.ads │ └── a-cgcaso.ads ├── pre-gcc12 │ ├── a-contai.ads │ ├── a-cgarso.ads │ └── a-cgcaso.ads ├── environment_task.ads ├── a-uncdea.ads ├── vApplicationStackOverflowHook.c ├── a-unccon.ads ├── a-ioexce.ads ├── s-fremem.ads ├── s-harhan.ads ├── cortex │ └── s-ftinis.adb ├── a-except.adb ├── last_chance_handler.c ├── s-fresem.ads ├── s-fretcb.ads ├── a-except.ads ├── riscv │ └── s-ftinis.adb ├── a-string.ads ├── a-iteint.ads ├── s-fretcb.adb ├── a-sytaco.adb ├── s-freert.ads ├── common.gpr ├── s-freque.ads ├── gcc6 │ └── s-secsta.adb ├── gcc7 │ └── s-secsta.adb ├── gcc12 │ └── s-secsta.adb ├── gcc8 │ └── s-secsta.adb ├── gnat-gpl-2017 │ └── s-secsta.adb └── gnat.ads ├── compiler-dummy-rts ├── rts-dummy │ ├── adalib │ │ └── empty.ali │ └── adainclude │ │ └── system.ads ├── ada_object_path ├── ada_source_path └── README-for-rts-dummy ├── demos-arduino-due ├── .gdbinit ├── first_task.ads ├── debounce_impl.ads ├── first.adb ├── debounce.adb ├── Makefile ├── first.gpr └── debounce.gpr ├── test-stm32f4 ├── gnat.adc ├── delay_in_po-main.adb ├── action_after_delay-main.adb ├── delay_in_po.ads ├── action_after_delay.ads ├── delay_in_po.adb ├── heartbeat.ads ├── faulting_task.ads ├── divide.c ├── action_after_delay.adb ├── Makefile ├── generate_hard_fault.adb └── faulting_task.adb ├── .gitmodules ├── .gitignore ├── .hgignore ├── test-common ├── so.ads ├── images.ads ├── strings.ads ├── iteration.ads ├── containing.ads ├── interrupts.ads ├── floating_point.ads ├── streams.ads ├── last_chance_handler.ads ├── dispatching.ads ├── streams.adb ├── so.adb ├── last_chance_handler.adb ├── dispatching.adb └── strings.adb ├── test-arduino-due ├── heartbeat.ads ├── Makefile ├── watchdog_check.ads └── testbed.gpr ├── test-stm32f429i ├── heartbeat.ads ├── Makefile └── testbed.gpr ├── test-microbit ├── leds.ads ├── buttons.ads ├── lights.ads ├── seconds.adb ├── Makefile ├── accelerometer.adb ├── events.adb ├── event_support.ads ├── circle.adb ├── event_support.adb └── tests.gpr ├── Makefile └── FreeRTOS.gpr /microbit/.gitignore: -------------------------------------------------------------------------------- 1 | nrf51/ -------------------------------------------------------------------------------- /arduino-due/.gitignore: -------------------------------------------------------------------------------- 1 | atsam3x8e/ -------------------------------------------------------------------------------- /stm32f4/.gitignore: -------------------------------------------------------------------------------- 1 | stm32f40x/ 2 | -------------------------------------------------------------------------------- /stm32f429i/.gitignore: -------------------------------------------------------------------------------- 1 | stm32f429x/ -------------------------------------------------------------------------------- /common/.gitignore: -------------------------------------------------------------------------------- 1 | math/ 2 | ordered_maps/ 3 | -------------------------------------------------------------------------------- /common/gnat-ce-2020/.gitignore: -------------------------------------------------------------------------------- 1 | unsigned-float/ -------------------------------------------------------------------------------- /compiler-dummy-rts/rts-dummy/adalib/empty.ali: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compiler-dummy-rts/ada_object_path: -------------------------------------------------------------------------------- 1 | rts-dummy/adalib 2 | -------------------------------------------------------------------------------- /compiler-dummy-rts/ada_source_path: -------------------------------------------------------------------------------- 1 | rts-dummy/adainclude 2 | -------------------------------------------------------------------------------- /demos-arduino-due/.gdbinit: -------------------------------------------------------------------------------- 1 | target remote :2331 2 | load 3 | -------------------------------------------------------------------------------- /microbit/ada_source_path: -------------------------------------------------------------------------------- 1 | adainclude 2 | ../common 3 | ../common/math 4 | -------------------------------------------------------------------------------- /stm32f4/ada_source_path: -------------------------------------------------------------------------------- 1 | adainclude 2 | ../common 3 | ../common/math 4 | -------------------------------------------------------------------------------- /stm32f429i/ada_source_path: -------------------------------------------------------------------------------- 1 | adainclude 2 | ../common 3 | ../common/math 4 | -------------------------------------------------------------------------------- /arduino-due/ada_source_path: -------------------------------------------------------------------------------- 1 | adainclude 2 | atsam3x8e 3 | ../common 4 | ../common/math 5 | -------------------------------------------------------------------------------- /compiler-dummy-rts/rts-dummy/adainclude/system.ads: -------------------------------------------------------------------------------- 1 | -- This is a dummy file, to satisfy the existence checks in gnatls 2 | -- and gprconfig. 3 | -------------------------------------------------------------------------------- /test-stm32f4/gnat.adc: -------------------------------------------------------------------------------- 1 | -- Used to demonstrate that sequential elaboration can be invoked. 2 | pragma Partition_Elaboration_Policy (Sequential); 3 | -------------------------------------------------------------------------------- /microbit/adalib/.keep_adalib: -------------------------------------------------------------------------------- 1 | This file is registered in git: the point is, without an adalib/, 2 | gprbuild won't recognise .. as a valid RTS. 3 | 4 | We could also use a file ada_object_path, but it'd be meaningless. 5 | -------------------------------------------------------------------------------- /stm32f4/adalib/.keep_adalib: -------------------------------------------------------------------------------- 1 | This file is registered in git: the point is, without an adalib/, 2 | gprbuild won't recognise .. as a valid RTS. 3 | 4 | We could also use a file ada_object_path, but it'd be meaningless. 5 | -------------------------------------------------------------------------------- /arduino-due/adalib/.keep_adalib: -------------------------------------------------------------------------------- 1 | This file is registered in git: the point is, without an adalib/, 2 | gprbuild won't recognise .. as a valid RTS. 3 | 4 | We could also use a file ada_object_path, but it'd be meaningless. 5 | -------------------------------------------------------------------------------- /stm32f429i/adalib/.keep_adalib: -------------------------------------------------------------------------------- 1 | This file is registered in git: the point is, without an adalib/, 2 | gprbuild won't recognise .. as a valid RTS. 3 | 4 | We could also use a file ada_object_path, but it'd be meaningless. 5 | -------------------------------------------------------------------------------- /common/README: -------------------------------------------------------------------------------- 1 | This is the shared part of an Ada Runtime System (RTS) for the GCC Ada 2 | compiler (GNAT), targeted to the STMicroelectronics STM32F4 Discovery 3 | boards (see http://www.st.com) and to Arduino Due (see 4 | http://www.arduino.org). 5 | -------------------------------------------------------------------------------- /compiler-dummy-rts/README-for-rts-dummy: -------------------------------------------------------------------------------- 1 | This isn't a real RTS; instead, it's the minimal set of files required 2 | to allow gprconfig to recognise a compiler as usable. 3 | 4 | Copy to a newly-built cross-compiler's RTS directory: for example, 5 | $prefix/lib/gcc/arm-eabi/5.1.0/. -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "FreeRTOS-Kernel"] 2 | path = FreeRTOS-Kernel 3 | url = git@github.com:FreeRTOS/FreeRTOS-Kernel.git 4 | [submodule "Ada_Drivers_Library"] 5 | path = Ada_Drivers_Library 6 | url = https://github.com/AdaCore/Ada_Drivers_Library.git 7 | [submodule "svd2ada"] 8 | path = svd2ada 9 | url = https://github.com/AdaCore/svd2ada.git 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.ali 2 | *.o 3 | *.a 4 | *.bexch 5 | *.ci 6 | *.orig 7 | *.bin 8 | *.map 9 | *-loc.xml 10 | *-stamp 11 | 12 | b__*.ad? 13 | 14 | .build* 15 | obj 16 | test 17 | doc 18 | cortex-gnat-rts* 19 | .DS_Store 20 | 21 | auto.cgpr 22 | gnatinspect.db 23 | gpr_query.* 24 | 25 | local/ 26 | 27 | demos-arduino-due/debounce_hardware 28 | demos-arduino-due/debounce_software 29 | demos-arduino-due/first 30 | 31 | test-arduino-due/ 32 | test-microbit/ 33 | test-stm32f4/ 34 | test-stm32f429i/ 35 | 36 | t/ 37 | -------------------------------------------------------------------------------- /test-stm32f4/delay_in_po-main.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2020 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- Copying and distribution of this file, with or without 6 | -- modification, are permitted in any medium without royalty provided 7 | -- the copyright notice and this notice are preserved. This file is 8 | -- offered as-is, without any warranty. 9 | 10 | procedure Delay_In_PO.Main is 11 | begin 12 | PO.Potentially_Blocking; 13 | end Delay_In_PO.Main; 14 | -------------------------------------------------------------------------------- /test-stm32f4/action_after_delay-main.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2020 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- Copying and distribution of this file, with or without 6 | -- modification, are permitted in any medium without royalty provided 7 | -- the copyright notice and this notice are preserved. This file is 8 | -- offered as-is, without any warranty. 9 | 10 | with Ada.Real_Time; 11 | procedure Action_After_Delay.Main is 12 | begin 13 | delay until Ada.Real_Time.Time_Last; 14 | end Action_After_Delay.Main; 15 | -------------------------------------------------------------------------------- /test-stm32f4/delay_in_po.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2020 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- Copying and distribution of this file, with or without 6 | -- modification, are permitted in any medium without royalty provided 7 | -- the copyright notice and this notice are preserved. This file is 8 | -- offered as-is, without any warranty. 9 | 10 | -- The purpose of this little suite is to provoke Program_Error by a 11 | -- 'delay until' inside a protected object. 12 | 13 | package Delay_In_PO is 14 | 15 | protected PO is 16 | procedure Potentially_Blocking; 17 | end PO; 18 | 19 | end Delay_In_PO; 20 | -------------------------------------------------------------------------------- /test-stm32f4/action_after_delay.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2020 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- Copying and distribution of this file, with or without 6 | -- modification, are permitted in any medium without royalty provided 7 | -- the copyright notice and this notice are preserved. This file is 8 | -- offered as-is, without any warranty. 9 | 10 | -- The purpose of this little suite is to determine what happens when 11 | -- one task is running and another, at the same priority, exits a 12 | -- delay; will it run or be blocked? 13 | 14 | package Action_After_Delay with Elaborate_Body is 15 | end Action_After_Delay; 16 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | 3 | # Maciej's book examples 4 | Ada_on_Cortex 5 | 6 | *.ali 7 | *.o 8 | *.a 9 | *.bexch 10 | *.ci 11 | *.orig 12 | *.bin 13 | *.map 14 | *-loc.xml 15 | 16 | b__*.ad? 17 | 18 | .build* 19 | obj 20 | test 21 | doc 22 | cortex-gnat-rts* 23 | 24 | stm32f429xx_h.ads 25 | 26 | auto.cgpr 27 | gnatinspect.db 28 | 29 | demo_leds-stm32f4/demo 30 | demo_leds-stm32f429i-disco/demo 31 | 32 | demo-stm32f429i-disco-bsp/ada_delay 33 | demo-stm32f429i-disco-rtos/demo_cmsis 34 | demo-stm32f429i-disco-rtos/demo_tasking 35 | demo-stm32f429i-disco-rtos/lcd 36 | 37 | demos-arduino-due/debounce 38 | demos-arduino-due/first 39 | 40 | test-arduino-due/testbed 41 | 42 | test-stm32f4/ 43 | -------------------------------------------------------------------------------- /test-stm32f4/delay_in_po.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2020 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- Copying and distribution of this file, with or without 6 | -- modification, are permitted in any medium without royalty provided 7 | -- the copyright notice and this notice are preserved. This file is 8 | -- offered as-is, without any warranty. 9 | 10 | with Ada.Real_Time; 11 | 12 | package body Delay_In_PO is 13 | 14 | protected body PO is 15 | 16 | procedure Potentially_Blocking is 17 | begin 18 | delay until Ada.Real_Time.Time_Last; 19 | end Potentially_Blocking; 20 | 21 | end PO; 22 | 23 | end Delay_In_PO; 24 | -------------------------------------------------------------------------------- /test-common/so.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package SO with Elaborate_Body is 20 | end SO; 21 | -------------------------------------------------------------------------------- /test-common/images.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2017 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Images with Elaborate_Body is 20 | end Images; 21 | -------------------------------------------------------------------------------- /test-common/strings.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Strings with Elaborate_Body is 20 | end Strings; 21 | -------------------------------------------------------------------------------- /test-common/iteration.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Iteration with Elaborate_Body is 20 | end Iteration; 21 | -------------------------------------------------------------------------------- /test-stm32f4/heartbeat.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Heartbeat with Elaborate_Body is 20 | end Heartbeat; 21 | -------------------------------------------------------------------------------- /test-arduino-due/heartbeat.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Heartbeat with Elaborate_Body is 20 | end Heartbeat; 21 | -------------------------------------------------------------------------------- /test-common/containing.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Containing with Elaborate_Body is 20 | end Containing; 21 | -------------------------------------------------------------------------------- /test-common/interrupts.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Interrupts with Elaborate_Body is 20 | end Interrupts; 21 | -------------------------------------------------------------------------------- /test-stm32f429i/heartbeat.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Heartbeat with Elaborate_Body is 20 | end Heartbeat; 21 | -------------------------------------------------------------------------------- /demos-arduino-due/first_task.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the Cortex GNAT RTS package. 4 | -- 5 | -- The Cortex GNAT RTS package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package First_Task with Elaborate_Body is 20 | end First_Task; 21 | -------------------------------------------------------------------------------- /test-common/floating_point.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Floating_Point with Elaborate_Body is 20 | end Floating_Point; 21 | -------------------------------------------------------------------------------- /test-common/streams.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Streams is 20 | procedure Check (N : Integer); 21 | end Streams; 22 | -------------------------------------------------------------------------------- /test-stm32f4/faulting_task.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2017 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Faulting_Task with Elaborate_Body is 20 | end Faulting_Task; 21 | -------------------------------------------------------------------------------- /demos-arduino-due/debounce_impl.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the Cortex GNAT RTS package. 4 | -- 5 | -- The Cortex GNAT RTS package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Debounce_Impl with Elaborate_Body is 20 | end Debounce_Impl; 21 | -------------------------------------------------------------------------------- /demos-arduino-due/first.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the Cortex GNAT RTS package. 4 | -- 5 | -- The Cortex GNAT RTS package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with First_Task; 20 | pragma Unreferenced (First_Task); 21 | with Ada.Real_Time; 22 | procedure First is 23 | begin 24 | delay until Ada.Real_Time.Time_Last; 25 | end First; 26 | -------------------------------------------------------------------------------- /test-microbit/leds.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2018 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package LEDs 20 | with Elaborate_Body 21 | is 22 | 23 | type Coord is range 1 .. 5; 24 | 25 | procedure Clear_All_LEDs; 26 | procedure Set_One_LED (Row, Col : Coord); 27 | 28 | end LEDs; 29 | -------------------------------------------------------------------------------- /test-microbit/buttons.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2018 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Buttons 20 | with Elaborate_Body 21 | is 22 | 23 | type Button is (A, B); 24 | type Toggle is (Off, On); 25 | 26 | function Button_State (Btn : Button) return Toggle; 27 | 28 | end Buttons; 29 | -------------------------------------------------------------------------------- /test-stm32f4/divide.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Free Software Foundation, Inc. 2 | 3 | // This file is part of the FreeRTOS-Ada package. 4 | // 5 | // The FreeRTOS-Ada package is free software; you can redistribute 6 | // it and/or modify it under the terms of the GNU General Public 7 | // License as published by the Free Software Foundation; either 8 | // version 3 of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | // General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; see the file COPYING3. If not, see 17 | // . 18 | 19 | // The purpose of this is to actually perform a division even if rho 20 | // is 0, so that a HardFault will occur (if enabled, of course) 21 | 22 | int div(int lho, int rho) 23 | { 24 | return lho/rho; 25 | } 26 | -------------------------------------------------------------------------------- /stm32f429i/README.md: -------------------------------------------------------------------------------- 1 | This is an Ada Runtime System (RTS) for the GCC Ada compiler (GNAT), targeted to the STMicroelectronics [STM32F429I Discovery board](http://www.st.com/). 2 | 3 | The RTS supports Ravenscar tasking. Package System contains the following additional restrictions: 4 | 5 | * pragma Restrictions (No_Exception_Propagation); 6 | * pragma Restrictions (No_Finalization); 7 | 8 | The RTS is intended to support commercial binary distributions. The Ada source code has either been derived from FSF GCC (4.9.1 or later) or written for this work; see the files COPYING3 and COPYING.RUNTIME. 9 | 10 | The RTS is based on [FreeRTOS](http://www.freertos.org). See COPYING.FreeRTOS. 11 | 12 | Board support (spec files only) is generated using [svd2ada](https://github.com/AdaCore/svd2ada). 13 | 14 | The following non-original files don't form part of a binary deliverable, so don't affect the status of the binary: 15 | 16 | * `build_runtime.gpr` and `runtime.xml` originated in AdaCore's GNAT GPL 2014 arm-eabi distribution (for Linux). 17 | 18 | * The linker script `stm32f429i-flash.ld` is under an MIT licence: see COPYING.MIT. 19 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # This file is part of the FreeRTOS-Ada package. 2 | # 3 | # Copyright (C) 2016-2024 Free Software Foundation, Inc. 4 | # 5 | # The FreeRTOS-Ada package is free software; you can redistribute 6 | # it and/or modify it under the terms of the GNU General Public 7 | # License as published by the Free Software Foundation; either version 8 | # 3 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not, see 17 | # . 18 | 19 | first: 20 | @echo "\t'make all' to build the runtimes," 21 | @echo "\t'make install' to install the runtimes." 22 | 23 | runtimes = arduino-due microbit stm32f4 stm32f429i 24 | 25 | all install clean: 26 | for f in $(runtimes); do \ 27 | make -w -C $$f $@; \ 28 | done 29 | 30 | .PHONY: first all clean install 31 | -------------------------------------------------------------------------------- /common/os_exit.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is free software; you can redistribute it and/or modify 4 | -- it under terms of the GNU General Public License as published by 5 | -- the Free Software Foundation; either version 3, or (at your 6 | -- option) any later version. This file is distributed in the hope 7 | -- that it will be useful, but WITHOUT ANY WARRANTY; without even the 8 | -- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 9 | -- PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | procedure OS_Exit (Code : Integer) with 22 | Export, 23 | Convention => C, 24 | External_Name => "exit", 25 | No_Return; 26 | -------------------------------------------------------------------------------- /test-stm32f4/action_after_delay.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2020 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- Copying and distribution of this file, with or without 6 | -- modification, are permitted in any medium without royalty provided 7 | -- the copyright notice and this notice are preserved. This file is 8 | -- offered as-is, without any warranty. 9 | 10 | with Ada.Real_Time; 11 | 12 | package body Action_After_Delay is 13 | 14 | task T1; 15 | task T2; 16 | 17 | T2_Has_Run : Boolean := False with Volatile; 18 | 19 | task body T1 is 20 | begin 21 | loop 22 | exit when T2_Has_Run; 23 | end loop; 24 | -- PE here (because it's illegal in Ravenscar to exit a task) 25 | -- if T2 has run 26 | end T1; 27 | 28 | task body T2 is 29 | use type Ada.Real_Time.Time; 30 | begin 31 | delay until Ada.Real_Time.Clock + Ada.Real_Time.Seconds (1); 32 | -- Shouldn't get here, since T1 hasn't reached a dispatching 33 | -- point. 34 | T2_Has_Run := True; 35 | delay until Ada.Real_Time.Time_Last; 36 | end T2; 37 | 38 | end Action_After_Delay; 39 | -------------------------------------------------------------------------------- /test-arduino-due/Makefile: -------------------------------------------------------------------------------- 1 | # This file is part of the FreeRTOS-Ada package. 2 | # 3 | # Copyright (C) 2016-2024 Free Software Foundation, Inc. 4 | # 5 | # The FreeRTOS-Ada package is free software; you can redistribute 6 | # it and/or modify it under the terms of the GNU General Public 7 | # License as published by the Free Software Foundation; either version 8 | # 3 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not, see 17 | # . 18 | 19 | all:: testbed 20 | 21 | programs = testbed 22 | 23 | testbed: force 24 | gprbuild -p -P testbed.gpr 25 | 26 | %.bin: % 27 | arm-eabi-objcopy -O binary $< $@ 28 | 29 | clean: 30 | for p in $(programs); do \ 31 | (gprclean -P $$p || true); \ 32 | done 33 | rm -f *.bin 34 | 35 | .PHONY: all build clean force 36 | -------------------------------------------------------------------------------- /microbit/COPYING.FreeRTOS: -------------------------------------------------------------------------------- 1 | The FreeRTOS kernel is provided under the following MIT open source 2 | licence. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /stm32f4/COPYING.FreeRTOS: -------------------------------------------------------------------------------- 1 | The FreeRTOS kernel is provided under the following MIT open source 2 | licence. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /test-common/last_chance_handler.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016-2024 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with Interfaces.C.Strings; 20 | 21 | procedure Last_Chance_Handler 22 | (Message : Interfaces.C.Strings.chars_ptr; Line : Integer) with 23 | Preelaborate => True, 24 | Export => True, 25 | Convention => C, 26 | External_Name => "__gnat_last_chance_handler"; 27 | -------------------------------------------------------------------------------- /arduino-due/COPYING.FreeRTOS: -------------------------------------------------------------------------------- 1 | The FreeRTOS kernel is provided under the following MIT open source 2 | licence. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /arduino-due/README: -------------------------------------------------------------------------------- 1 | This is an Ada Runtime System (RTS) for the GCC Ada compiler (GNAT), 2 | targeted to the Arduino Due board (see http://www.arduino.org/). 3 | 4 | The RTS supports Ravenscar tasking. Package System contains the 5 | following additional restrictions: 6 | 7 | pragma Restrictions (No_Exception_Propagation); 8 | pragma Restrictions (No_Finalization); 9 | 10 | The RTS is intended to support commercial binary distributions. The 11 | Ada source code has either been derived from FSF GCC (4.9.1 or later) 12 | or written for this work; see the files COPYING3 and COPYING.RUNTIME. 13 | 14 | The RTS is based on FreeRTOS[1]. See COPYING.FreeRTOS. 15 | 16 | Board support (spec files only) is generated using svd2ada[2] from the 17 | Atmel SVD. See COPYING.Atmel. 18 | 19 | The following non-original files don't form part of a binary 20 | deliverable, so don't affect the status of the binary: 21 | 22 | o build_runtime.gpr and runtime.xml originated in AdaCore's GNAT GPL 23 | 2014 arm-eabi distribution (for Linux). 24 | 25 | o The linker script due-flash.ld is under an MIT licence: see 26 | COPYING.MIT. 27 | 28 | [1] http://www.freertos.org 29 | [2] https://github.com/AdaCore/svd2ada 30 | -------------------------------------------------------------------------------- /common/os_exit.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is free software; you can redistribute it and/or modify 4 | -- it under terms of the GNU General Public License as published by 5 | -- the Free Software Foundation; either version 3, or (at your 6 | -- option) any later version. This file is distributed in the hope 7 | -- that it will be useful, but WITHOUT ANY WARRANTY; without even the 8 | -- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 9 | -- PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | procedure OS_Exit (Code : Integer) is 22 | pragma Unreferenced (Code); 23 | begin 24 | loop 25 | null; 26 | end loop; 27 | end OS_Exit; 28 | -------------------------------------------------------------------------------- /stm32f429i/COPYING.FreeRTOS: -------------------------------------------------------------------------------- 1 | The FreeRTOS kernel is provided under the following MIT open source 2 | licence. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /microbit/COPYING.MIT: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2007, 2008, 2009, 2010 Dado Sutter and Bogdan Marinescu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /stm32f4/COPYING.MIT: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2007, 2008, 2009, 2010 Dado Sutter and Bogdan Marinescu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /stm32f4/README.md: -------------------------------------------------------------------------------- 1 | This is an Ada Runtime System (RTS) for the GCC Ada compiler (GNAT), targeted to the STMicroelectronics [STM32F4 Discovery board](https://uk.farnell.com/stmicroelectronics/stm32f407g-disc1/dev-board-foundation-line-mcu/dp/2506840). 2 | 3 | The RTS supports Ravenscar tasking. Package System contains the following additional restrictions: 4 | 5 | * `pragma Restrictions (No_Exception_Propagation);` 6 | * `pragma Restrictions (No_Finalization);` 7 | 8 | The RTS is intended to support commercial binary distributions. The Ada source code has either been derived from FSF GCC (4.9.1 or later) or written for this work; see the files COPYING3 and COPYING.RUNTIME. 9 | 10 | The RTS is based on [FreeRTOS](http://www.freertos.org). See COPYING.FreeRTOS. 11 | 12 | Board support (spec files only) was generated using [svd2ada](https://github.com/AdaCore/svd2ada). 13 | 14 | The following non-original files don't form part of a binary deliverable, so don't affect the status of the binary: 15 | 16 | * `build_runtime.gpr` and `runtime.xml` originated in AdaCore's GNAT GPL 2014 arm-eabi distribution (for Linux). 17 | 18 | * The linker script `stm32f407-flash.ld` is under an MIT licence: see COPYING.MIT. 19 | -------------------------------------------------------------------------------- /arduino-due/COPYING.MIT: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2007, 2008, 2009, 2010 Dado Sutter and Bogdan Marinescu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /arduino-due/runtime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /stm32f429i/COPYING.MIT: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2007, 2008, 2009, 2010 Dado Sutter and Bogdan Marinescu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /microbit/adainclude/startup.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | pragma Restrictions (No_Elaboration_Code); 22 | package Startup is 23 | pragma Elaborate_Body; 24 | end Startup; 25 | -------------------------------------------------------------------------------- /stm32f4/adainclude/startup.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | pragma Restrictions (No_Elaboration_Code); 22 | package Startup is 23 | pragma Elaborate_Body; 24 | end Startup; 25 | -------------------------------------------------------------------------------- /arduino-due/adainclude/startup.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | pragma Restrictions (No_Elaboration_Code); 22 | package Startup is 23 | pragma Elaborate_Body; 24 | end Startup; 25 | -------------------------------------------------------------------------------- /stm32f429i/adainclude/startup.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | pragma Restrictions (No_Elaboration_Code); 22 | package Startup is 23 | pragma Elaborate_Body; 24 | end Startup; 25 | -------------------------------------------------------------------------------- /common/adaint.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Free Software Foundation, Inc. 2 | // 3 | // GNAT is free software; you can redistribute it and/or modify it under 4 | // terms of the GNU General Public License as published by the Free Soft- 5 | // ware Foundation; either version 3, or (at your option) any later ver- 6 | // sion. GNAT is distributed in the hope that it will be useful, but WITH- 7 | // OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 8 | // or FITNESS FOR A PARTICULAR PURPOSE. 9 | // 10 | // As a special exception under Section 7 of GPL version 3, you are granted 11 | // additional permissions described in the GCC Runtime Library Exception, 12 | // version 3.1, as published by the Free Software Foundation. 13 | // 14 | // You should have received a copy of the GNU General Public License and 15 | // a copy of the GCC Runtime Library Exception along with this program; 16 | // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 17 | // . 18 | // 19 | // The variable __gl_main_priority is initialized to -1 20 | // (System.Tasking.Unspecified_Priority) and will be updated if the main 21 | // program has pragma Priority. 22 | 23 | int __gl_main_priority = -1; 24 | -------------------------------------------------------------------------------- /stm32f4/runtime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /stm32f429i/runtime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /test-microbit/lights.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2018 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Lights 20 | with Elaborate_Body 21 | is 22 | 23 | -- Displays a spiral on the LEDs. 24 | -- 25 | -- Button A controls the speed (it toggles between 100 and 50 ms 26 | -- per LED). 27 | -- 28 | -- Button B controls the direction (it toggles between spiralling 29 | -- in and spiralling out). 30 | 31 | end Lights; 32 | -------------------------------------------------------------------------------- /common/a-charac.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . C H A R A C T E R S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | package Ada.Characters is 17 | pragma Pure; 18 | end Ada.Characters; 19 | -------------------------------------------------------------------------------- /test-stm32f429i/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2024 Free Software Foundation, Inc. 2 | # 3 | # This file is part of the FreeRTOS-Ada package. 4 | # 5 | # The FreeRTOS-Ada package is free software; you can redistribute 6 | # it and/or modify it under the terms of the GNU General Public 7 | # License as published by the Free Software Foundation; either version 8 | # 3 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not, see 17 | # . 18 | 19 | export ADL_BUILD=Debug 20 | export ADL_BUILD_CHECKS=Disabled 21 | export CALLGRAPHS=Disabled 22 | 23 | all: testbed.bin 24 | 25 | testbed: force 26 | gprbuild -p -P testbed 27 | clean:: 28 | gprclean -P testbed 29 | 30 | clean:: 31 | -rm *~ *.ali *.o *.bin 32 | -rm -rf .build 33 | 34 | %.bin: % 35 | arm-eabi-objcopy -O binary $^ $@ 36 | 37 | .PHONY: all clean force 38 | -------------------------------------------------------------------------------- /test-stm32f4/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2024 Free Software Foundation, Inc. 2 | # 3 | # This file is part of the FreeRTOS-Ada package. 4 | # 5 | # The FreeRTOS-Ada package is free software; you can redistribute 6 | # it and/or modify it under the terms of the GNU General Public 7 | # License as published by the Free Software Foundation; either version 8 | # 3 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not, see 17 | # . 18 | 19 | export ADL_BUILD=Production 20 | export ADL_BUILD_CHECKS=Disabled 21 | export CALLGRAPHS=Disabled 22 | 23 | all: testbed.bin 24 | 25 | testbed: force 26 | gprbuild -p -P testbed 27 | clean:: 28 | gprclean -P testbed 29 | 30 | clean:: 31 | -rm *~ *.ali *.o *.bin 32 | -rm -rf .build 33 | 34 | %.bin: % 35 | arm-eabi-objcopy -O binary $^ $@ 36 | 37 | .PHONY: all clean force 38 | -------------------------------------------------------------------------------- /common/ada.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | package Ada is 17 | pragma Pure; 18 | pragma No_Elaboration_Code_All; 19 | end Ada; 20 | -------------------------------------------------------------------------------- /common/machcode.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT COMPILER COMPONENTS -- 4 | -- -- 5 | -- M A C H I N E _ C O D E -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with System.Machine_Code; 17 | 18 | package Machine_Code renames System.Machine_Code; 19 | -------------------------------------------------------------------------------- /test-common/dispatching.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package Dispatching is 20 | 21 | private 22 | 23 | type Base is abstract tagged null record; 24 | function Value (B : Base) return Integer is abstract; 25 | function Basis (B : Base) return Character; 26 | 27 | type Derived is new Base with null record; 28 | overriding 29 | function Value (D : Derived) return Integer; 30 | 31 | end Dispatching; 32 | -------------------------------------------------------------------------------- /microbit/adainclude/nrf51_clock.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2018 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | pragma Restrictions (No_Elaboration_Code); 22 | 23 | package nRF51_Clock 24 | with Elaborate_Body 25 | is 26 | 27 | procedure Start; 28 | 29 | end nRF51_Clock; 30 | -------------------------------------------------------------------------------- /microbit/adainclude/startup-set_up_clock.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2018 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | with nRF51_Clock; 22 | 23 | separate (Startup) 24 | procedure Set_Up_Clock is 25 | 26 | begin 27 | 28 | nRF51_Clock.Start; 29 | 30 | end Set_Up_Clock; 31 | -------------------------------------------------------------------------------- /demos-arduino-due/debounce.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2019 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the Cortex GNAT RTS package. 4 | -- 5 | -- The Cortex GNAT RTS package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | -- This is the main program of the debounce demo. 20 | -- 21 | -- Depending on the GPR scenario variable IMPL (default software), 22 | -- debouncing will be done by software (see debounce_software.adb) or 23 | -- hardware (debounce_hardware.adb). 24 | 25 | with Debounce_Impl; 26 | with Ada.Real_Time; 27 | procedure Debounce is 28 | begin 29 | delay until Ada.Real_Time.Time_Last; 30 | end Debounce; 31 | -------------------------------------------------------------------------------- /FreeRTOS.gpr: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2017-2022 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | abstract project FreeRTOS is 20 | 21 | Freertos_Kernel := external ("FREERTOS_KERNEL", 22 | project'Project_Dir & "FreeRTOS-Kernel") 23 | & "/"; 24 | 25 | Source := Freertos_Kernel; 26 | Include := Freertos_Kernel & "include"; 27 | Portable_Base := Freertos_Kernel & "portable/GCC/"; 28 | -- You'll need to add e.g. "ARM_CM3" for your processor 29 | 30 | end FreeRTOS; 31 | -------------------------------------------------------------------------------- /test-microbit/seconds.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2018 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with LEDs; 20 | 21 | with Ada.Real_Time; 22 | 23 | procedure Seconds is 24 | Next : Ada.Real_Time.Time := Ada.Real_Time.Clock; 25 | use type Ada.Real_Time.Time; 26 | begin 27 | loop 28 | LEDs.Set_One_LED (3, 3); 29 | delay until Next + Ada.Real_Time.Milliseconds (100); 30 | Next := Next + Ada.Real_Time.Seconds (1); 31 | LEDs.Clear_All_LEDs; 32 | delay until Next; 33 | end loop; 34 | end Seconds; 35 | -------------------------------------------------------------------------------- /test-common/streams.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with Memory_Streams; 20 | 21 | package body Streams is 22 | 23 | Str : aliased Memory_Streams.Stream_Type (Capacity => 32); 24 | 25 | procedure Check (N : Integer) is 26 | M : Integer; 27 | begin 28 | Integer'Write (Str'Access, N); 29 | Integer'Read (Str'Access, M); 30 | if M /= N then 31 | raise Program_Error with "Streams.Check: M /= N"; 32 | end if; 33 | end Check; 34 | 35 | end Streams; 36 | -------------------------------------------------------------------------------- /common/math/a-nurear.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . N U M E R I C S . R E A L _ A R R A Y S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Real_Arrays; 17 | 18 | package Ada.Numerics.Real_Arrays is 19 | new Ada.Numerics.Generic_Real_Arrays (Float); 20 | 21 | pragma Pure (Real_Arrays); 22 | -------------------------------------------------------------------------------- /microbit/README.md: -------------------------------------------------------------------------------- 1 | This is an Ada Runtime System (RTS) for the GCC Ada compiler (GNAT), targeted to the [BBC micro:bit board](http://microbit.org/). 2 | 3 | The RTS supports Ravenscar tasking. Package System contains the following additional restrictions: 4 | 5 | * `pragma Restrictions (No_Exception_Propagation);` 6 | * `pragma Restrictions (No_Finalization);` 7 | 8 | Aside from the limitations imposed by the small RAM size of the micro:bit (16K), the system clock runs at 100 Hz rather than the 1000 Hz used in the other RTSs in this family. 9 | 10 | The RTS is intended to support commercial binary distributions. The Ada source code has either been derived from FSF GCC (4.9.1, in some cases later) or written for this work; see the files `COPYING3` and `COPYING.RUNTIME`. 11 | 12 | The RTS is based on [FreeRTOS]( http://www.freertos.org). See `COPYING.FreeRTOS`. 13 | 14 | Board support (spec files only) was generated using [svd2ada](https://github.com/AdaCore/svd2ada) at commit `861c829` from the Nordic SVD. See `COPYING.Nordic`. 15 | 16 | The following non-original files don't form part of a binary deliverable, so don't affect the status of the binary: 17 | 18 | * `build_runtime.gpr` and `runtime.xml` originated in AdaCore's GNAT GPL 2014 arm-eabi distribution (for Linux). 19 | * The linker script `nrf51.ld` is under an MIT licence: see COPYING.MIT. 20 | -------------------------------------------------------------------------------- /common/math/a-nucoty.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . N U M E R I C S . C O M P L E X _ T Y P E S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Complex_Types; 17 | 18 | package Ada.Numerics.Complex_Types is 19 | new Ada.Numerics.Generic_Complex_Types (Float); 20 | 21 | pragma Pure (Complex_Types); 22 | -------------------------------------------------------------------------------- /common/math/a-nlrear.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . N U M E R I C S . L O N G _ R E A L _ A R R A Y S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Real_Arrays; 17 | 18 | package Ada.Numerics.Long_Real_Arrays is 19 | new Ada.Numerics.Generic_Real_Arrays (Long_Float); 20 | 21 | pragma Pure (Long_Real_Arrays); 22 | -------------------------------------------------------------------------------- /common/math/a-nlcoty.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . N U M E R I C S . L O N G _ C O M P L E X _ T Y P E S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Complex_Types; 17 | 18 | package Ada.Numerics.Long_Complex_Types is 19 | new Ada.Numerics.Generic_Complex_Types (Long_Float); 20 | 21 | pragma Pure (Long_Complex_Types); 22 | -------------------------------------------------------------------------------- /common/math/a-nscoty.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . N U M E R I C S . S H O R T _ C O M P L E X _ T Y P E S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Complex_Types; 17 | 18 | package Ada.Numerics.Short_Complex_Types is 19 | new Ada.Numerics.Generic_Complex_Types (Short_Float); 20 | 21 | pragma Pure (Short_Complex_Types); 22 | -------------------------------------------------------------------------------- /test-microbit/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2024 Free Software Foundation, Inc. 2 | # 3 | # This file is part of the FreeRTOS-Ada package. 4 | # 5 | # The FreeRTOS-Ada package is free software; you can redistribute 6 | # it and/or modify it under the terms of the GNU General Public 7 | # License as published by the Free Software Foundation; either version 8 | # 3 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not, see 17 | # . 18 | 19 | export ADL_BUILD=Debug 20 | export ADL_BUILD_CHECKS=Disabled 21 | export CALLGRAPHS=Disabled 22 | 23 | all: circle.hex events.hex seconds.hex accelerometer.hex 24 | 25 | circle events seconds accelerometer: rebuild.stamp 26 | rebuild.stamp: force 27 | gprbuild -p -P tests 28 | touch $@ 29 | clean:: 30 | gprclean -P tests 31 | rm -f rebuild.stamp 32 | 33 | clean:: 34 | -rm *~ *.ali *.o *.hex 35 | -rm -rf .build 36 | 37 | %.hex: % 38 | arm-eabi-objcopy -O ihex $^ $@ 39 | 40 | .PHONY: all clean force 41 | -------------------------------------------------------------------------------- /common/math/a-nllrar.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . N U M E R I C S . L O N G _ L O N G _R E A L _ A R R A Y S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Real_Arrays; 17 | 18 | package Ada.Numerics.Long_Long_Real_Arrays is 19 | new Ada.Numerics.Generic_Real_Arrays (Long_Long_Float); 20 | 21 | pragma Pure (Long_Long_Real_Arrays); 22 | -------------------------------------------------------------------------------- /arduino-due/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2024 Free Software Foundation, Inc. 2 | # 3 | # This file is part of the FreeRTOS-Ada package. 4 | # 5 | # The FreeRTOS-Ada package is free software; you can redistribute 6 | # it and/or modify it under the terms of the GNU General Public 7 | # License as published by the Free Software Foundation; either version 8 | # 3 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not, see 17 | # . 18 | 19 | SVD2ADA = ~/.alire/bin/svd2ada 20 | # alr get svd2ada; cd svd2ada*; alr build; alr install 21 | 22 | all: build 23 | 24 | build: atsam3x8e force 25 | gprbuild -p -P build_runtime.gpr 26 | 27 | atsam3x8e: ../svd2ada/CMSIS-SVD/ATMEL/ATSAM3X8E.svd 28 | $(SVD2ADA) \ 29 | --output=atsam3x8e \ 30 | --no-vfa-on-types \ 31 | $< 32 | 33 | install: all 34 | gprinstall -p -P build_runtime.gpr -f 35 | 36 | clean: 37 | -gprclean -P build_runtime.gpr 38 | rm -rf atsam3x8e 39 | 40 | .PHONY: all force install clean 41 | -------------------------------------------------------------------------------- /common/math/a-nllcty.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . N U M E R I C S . L O N G _ L O N G _ C O M P L E X _ T Y P E S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Complex_Types; 17 | 18 | package Ada.Numerics.Long_Long_Complex_Types is 19 | new Ada.Numerics.Generic_Complex_Types (Long_Long_Float); 20 | 21 | pragma Pure (Long_Long_Complex_Types); 22 | -------------------------------------------------------------------------------- /common/math/a-nuelfu.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . N U M E R I C S . E L E M E N T A R Y _ F U N C T I O N S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Elementary_Functions; 17 | 18 | package Ada.Numerics.Elementary_Functions is 19 | new Ada.Numerics.Generic_Elementary_Functions (Float); 20 | 21 | pragma Pure (Elementary_Functions); 22 | -------------------------------------------------------------------------------- /common/post-gcc12/a-contai.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT LIBRARY COMPONENTS -- 4 | -- -- 5 | -- A D A . C O N T A I N E R S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | package Ada.Containers is 17 | pragma Pure; 18 | 19 | type Hash_Type is mod 2**32; 20 | type Count_Type is range 0 .. 2**31 - 1; 21 | 22 | Capacity_Error : exception; 23 | 24 | end Ada.Containers; 25 | -------------------------------------------------------------------------------- /common/pre-gcc12/a-contai.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT LIBRARY COMPONENTS -- 4 | -- -- 5 | -- A D A . C O N T A I N E R S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | package Ada.Containers is 17 | pragma Pure; 18 | 19 | type Hash_Type is mod 2**32; 20 | type Count_Type is range 0 .. 2**31 - 1; 21 | 22 | Capacity_Error : exception; 23 | 24 | end Ada.Containers; 25 | -------------------------------------------------------------------------------- /common/math/a-nlelfu.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- ADA.NUMERICS.LONG_ELEMENTARY_FUNCTIONS -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Elementary_Functions; 17 | 18 | package Ada.Numerics.Long_Elementary_Functions is 19 | new Ada.Numerics.Generic_Elementary_Functions (Long_Float); 20 | 21 | pragma Pure (Long_Elementary_Functions); 22 | -------------------------------------------------------------------------------- /common/math/a-nselfu.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- ADA.NUMERICS.SHORT_ELEMENTARY_FUNCTIONS -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Elementary_Functions; 17 | 18 | package Ada.Numerics.Short_Elementary_Functions is 19 | new Ada.Numerics.Generic_Elementary_Functions (Short_Float); 20 | 21 | pragma Pure (Short_Elementary_Functions); 22 | -------------------------------------------------------------------------------- /demos-arduino-due/Makefile: -------------------------------------------------------------------------------- 1 | # This file is part of the FreeRTOS-Ada package. 2 | # 3 | # Copyright (C) 2016 Free Software Foundation, Inc. 4 | # 5 | # The FreeRTOS-Ada package is free software; you can redistribute 6 | # it and/or modify it under the terms of the GNU General Public 7 | # License as published by the Free Software Foundation; either version 8 | # 3 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not, see 17 | # . 18 | 19 | all:: first 20 | 21 | first: force 22 | gprbuild -p -P first.gpr 23 | 24 | debounce: debounce_software debounce_hardware 25 | 26 | debounce_software: force 27 | gprbuild -p -P debounce.gpr -XIMPL=software 28 | 29 | debounce_hardware: force 30 | gprbuild -p -P debounce.gpr -XIMPL=hardware 31 | 32 | %.bin: % 33 | arm-eabi-objcopy -O binary $< $@ 34 | 35 | clean: 36 | -gprclean -P first 37 | -gprclean -P debounce -XIMPL=software 38 | -gprclean -P debounce -XIMPL=hardware 39 | rm -f *.bin 40 | 41 | .PHONY: all build clean force 42 | -------------------------------------------------------------------------------- /microbit/runtime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /common/math/a-nllefu.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- ADA.NUMERICS.LONG_LONG_ELEMENTARY_FUNCTIONS -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Elementary_Functions; 17 | 18 | package Ada.Numerics.Long_Long_Elementary_Functions is 19 | new Ada.Numerics.Generic_Elementary_Functions (Long_Long_Float); 20 | 21 | pragma Pure (Long_Long_Elementary_Functions); 22 | -------------------------------------------------------------------------------- /common/environment_task.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2018 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | package Environment_Task is 22 | pragma No_Elaboration_Code_All; 23 | 24 | -- Creates the environment task, which runs the gnatbind-generated 25 | -- main (which runs adainit to do elaboration, then calls the Ada 26 | -- main program). 27 | procedure Create; 28 | 29 | end Environment_Task; 30 | -------------------------------------------------------------------------------- /common/a-uncdea.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT COMPILER COMPONENTS -- 4 | -- -- 5 | -- A D A . U N C H E C K E D _ D E A L L O C A T I O N -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | generic 17 | type Object (<>) is limited private; 18 | type Name is access Object; 19 | 20 | procedure Ada.Unchecked_Deallocation (X : in out Name); 21 | pragma Preelaborate (Unchecked_Deallocation); 22 | 23 | pragma Import (Intrinsic, Unchecked_Deallocation); 24 | -------------------------------------------------------------------------------- /microbit/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2024 Free Software Foundation, Inc. 2 | # 3 | # This file is part of the FreeRTOS-Ada package. 4 | # 5 | # The FreeRTOS-Ada package is free software; you can redistribute 6 | # it and/or modify it under the terms of the GNU General Public 7 | # License as published by the Free Software Foundation; either version 8 | # 3 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not, see 17 | # . 18 | 19 | SVD2ADA = ~/.alire/bin/svd2ada 20 | # alr get svd2ada; cd svd2ada*; alr build; alr install 21 | 22 | all: build 23 | 24 | build: nrf51 force 25 | gprbuild -p -P build_runtime.gpr 26 | 27 | nrf51: ../svd2ada/CMSIS-SVD/Nordic/nrf51.svd 28 | $(SVD2ADA) \ 29 | --output=nrf51 \ 30 | $< 31 | # would have liked to specify --no-vfa-on-types but this suppresses the use 32 | # of arrays. 33 | 34 | install: all 35 | gprinstall -p -P build_runtime.gpr -f 36 | 37 | clean: 38 | -gprclean -P build_runtime.gpr 39 | rm -rf nrf51 40 | 41 | .PHONY: all force install clean 42 | -------------------------------------------------------------------------------- /stm32f429i/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2024 Free Software Foundation, Inc. 2 | # 3 | # This file is part of the FreeRTOS-Ada package. 4 | # 5 | # The FreeRTOS-Ada package is free software; you can redistribute 6 | # it and/or modify it under the terms of the GNU General Public 7 | # License as published by the Free Software Foundation; either version 8 | # 3 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not, see 17 | # . 18 | 19 | SVD2ADA = ~/.alire/bin/svd2ada 20 | # alr get svd2ada; cd svd2ada*; alr build; alr install 21 | 22 | all: build 23 | 24 | build: stm32f429x force 25 | gprbuild -p -P build_runtime.gpr 26 | 27 | stm32f429x: ../svd2ada//CMSIS-SVD/ST/STM32F429x.svd 28 | $(SVD2ADA) \ 29 | --output=stm32f429x \ 30 | --no-vfa-on-types \ 31 | $< 32 | 33 | svd2ada-stamp: 34 | cd $(SVD2ADA); alr build 35 | touch $@ 36 | 37 | install: all 38 | gprinstall -p -P build_runtime.gpr -f 39 | 40 | clean: 41 | -gprclean -P build_runtime.gpr 42 | 43 | .PHONY: all force install clean 44 | -------------------------------------------------------------------------------- /common/math/a-nucoar.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . N U M E R I C S . C O M P L E X _ A R R A Y S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Complex_Arrays; 17 | with Ada.Numerics.Real_Arrays; 18 | with Ada.Numerics.Complex_Types; 19 | 20 | package Ada.Numerics.Complex_Arrays is 21 | new Ada.Numerics.Generic_Complex_Arrays (Real_Arrays, Complex_Types); 22 | 23 | pragma Pure (Complex_Arrays); 24 | -------------------------------------------------------------------------------- /stm32f4/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2024 Free Software Foundation, Inc. 2 | # 3 | # This file is part of the FreeRTOS-Ada package. 4 | # 5 | # The FreeRTOS-Ada package is free software; you can redistribute 6 | # it and/or modify it under the terms of the GNU General Public 7 | # License as published by the Free Software Foundation; either version 8 | # 3 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; see the file COPYING3. If not, see 17 | # . 18 | 19 | SVD2ADA = ~/.alire/bin/svd2ada 20 | # alr get svd2ada; cd svd2ada*; alr build; alr install 21 | 22 | all: build 23 | 24 | build: stm32f40x force 25 | gprbuild -p -P build_runtime.gpr 26 | 27 | stm32f40x: ../svd2ada//CMSIS-SVD/ST/STM32F40x.svd 28 | $(SVD2ADA) \ 29 | --output=stm32f40x \ 30 | --no-vfa-on-types \ 31 | $< 32 | 33 | svd2ada-stamp: 34 | cd $(SVD2ADA); alr build 35 | touch $@ 36 | 37 | install: all 38 | gprinstall -p -P build_runtime.gpr -f 39 | 40 | clean: 41 | -gprclean -P build_runtime.gpr 42 | rm -rf stm32f40x 43 | 44 | .PHONY: all force install clean 45 | -------------------------------------------------------------------------------- /common/vApplicationStackOverflowHook.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 Free Software Foundation, Inc. 2 | // 3 | // This file is part of the FreeRTOS-Ada project. This file is 4 | // free software; you can redistribute it and/or modify it under 5 | // terms of the GNU General Public License as published by the Free 6 | // Software Foundation; either version 3, or (at your option) any 7 | // later version. This file is distributed in the hope that it will 8 | // be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | // 11 | // As a special exception under Section 7 of GPL version 3, you are 12 | // granted additional permissions described in the GCC Runtime 13 | // Library Exception, version 3.1, as published by the Free Software 14 | // Foundation. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // and a copy of the GCC Runtime Library Exception along with this 18 | // program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | // If not, see . 20 | 21 | // Called if configCHECK_FOR_STACK_OVERFLOW is defined to non-zero and 22 | // a stack overflow is detected. 23 | 24 | #include 25 | #include 26 | 27 | void vApplicationStackOverflowHook(TaskHandle_t xTask, 28 | char *pcTaskName) { 29 | // Endless loop (for checking via debugger) 30 | for (;;); 31 | } 32 | -------------------------------------------------------------------------------- /common/math/a-nlcoar.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- ADA.NUMERICS.LONG_COMPLEX_ARRAYS -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Complex_Arrays; 17 | with Ada.Numerics.Long_Real_Arrays; 18 | with Ada.Numerics.Long_Complex_Types; 19 | 20 | package Ada.Numerics.Long_Complex_Arrays is new 21 | Ada.Numerics.Generic_Complex_Arrays (Long_Real_Arrays, Long_Complex_Types); 22 | 23 | pragma Pure (Long_Complex_Arrays); 24 | -------------------------------------------------------------------------------- /common/a-unccon.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT COMPILER COMPONENTS -- 4 | -- -- 5 | -- A D A . U N C H E C K E D _ C O N V E R S I O N -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | generic 17 | type Source (<>) is limited private; 18 | type Target (<>) is limited private; 19 | 20 | function Ada.Unchecked_Conversion (S : Source) return Target; 21 | pragma Pure (Unchecked_Conversion); 22 | pragma No_Elaboration_Code_All (Unchecked_Conversion); 23 | pragma Import (Intrinsic, Unchecked_Conversion); 24 | -------------------------------------------------------------------------------- /common/a-ioexce.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . I O _ E X C E P T I O N S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | package Ada.IO_Exceptions is 17 | pragma Pure; 18 | 19 | Status_Error : exception; 20 | Mode_Error : exception; 21 | Name_Error : exception; 22 | Use_Error : exception; 23 | Device_Error : exception; 24 | End_Error : exception; 25 | Data_Error : exception; 26 | Layout_Error : exception; 27 | 28 | end Ada.IO_Exceptions; 29 | -------------------------------------------------------------------------------- /common/math/a-ncelfu.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- ADA.NUMERICS.GENERIC_COMPLEX.ELEMENTARY_FUNCTIONS -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Complex_Types; 17 | with Ada.Numerics.Generic_Complex_Elementary_Functions; 18 | 19 | package Ada.Numerics.Complex_Elementary_Functions is 20 | new Ada.Numerics.Generic_Complex_Elementary_Functions 21 | (Ada.Numerics.Complex_Types); 22 | 23 | pragma Pure (Ada.Numerics.Complex_Elementary_Functions); 24 | -------------------------------------------------------------------------------- /common/math/a-nlcefu.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- ADA.NUMERICS.LONG_COMPLEX.ELEMENTARY_FUNCTIONS -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Long_Complex_Types; 17 | with Ada.Numerics.Generic_Complex_Elementary_Functions; 18 | 19 | package Ada.Numerics.Long_Complex_Elementary_Functions is 20 | new Ada.Numerics.Generic_Complex_Elementary_Functions 21 | (Ada.Numerics.Long_Complex_Types); 22 | pragma Pure (Ada.Numerics.Long_Complex_Elementary_Functions); 23 | -------------------------------------------------------------------------------- /common/math/a-nscefu.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- ADA.NUMERICS.SHORT.COMPLEX.ELEMENTARY_FUNCTIONS -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Short_Complex_Types; 17 | with Ada.Numerics.Generic_Complex_Elementary_Functions; 18 | 19 | package Ada.Numerics.Short_Complex_Elementary_Functions is 20 | new Ada.Numerics.Generic_Complex_Elementary_Functions 21 | (Ada.Numerics.Short_Complex_Types); 22 | pragma Pure (Ada.Numerics.Short_Complex_Elementary_Functions); 23 | -------------------------------------------------------------------------------- /common/math/a-nllcef.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- ADA.NUMERICS.LONG_LONG_COMPLEX.ELEMENTARY_FUNCTIONS -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Long_Long_Complex_Types; 17 | with Ada.Numerics.Generic_Complex_Elementary_Functions; 18 | 19 | package Ada.Numerics.Long_Long_Complex_Elementary_Functions is 20 | new Ada.Numerics.Generic_Complex_Elementary_Functions 21 | (Ada.Numerics.Long_Long_Complex_Types); 22 | pragma Pure (Ada.Numerics.Long_Long_Complex_Elementary_Functions); 23 | -------------------------------------------------------------------------------- /common/math/a-nllcar.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- ADA.NUMERICS.LONG_LONG_COMPLEX_ARRAYS -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | with Ada.Numerics.Generic_Complex_Arrays; 17 | with Ada.Numerics.Long_Long_Real_Arrays; 18 | with Ada.Numerics.Long_Long_Complex_Types; 19 | 20 | package Ada.Numerics.Long_Long_Complex_Arrays is 21 | new Ada.Numerics.Generic_Complex_Arrays (Long_Long_Real_Arrays, 22 | Long_Long_Complex_Types); 23 | 24 | pragma Pure (Long_Long_Complex_Arrays); 25 | -------------------------------------------------------------------------------- /common/post-gcc12/a-cgarso.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT LIBRARY COMPONENTS -- 4 | -- -- 5 | -- A D A . C O N T A I N E R S . G E N E R I C _ A R R A Y _ S O R T -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | generic 17 | type Index_Type is (<>); 18 | type Element_Type is private; 19 | type Array_Type is array (Index_Type range <>) of Element_Type; 20 | 21 | with function "<" (Left, Right : Element_Type) 22 | return Boolean is <>; 23 | 24 | procedure Ada.Containers.Generic_Array_Sort (Container : in out Array_Type); 25 | 26 | pragma Pure (Ada.Containers.Generic_Array_Sort); 27 | -------------------------------------------------------------------------------- /common/pre-gcc12/a-cgarso.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT LIBRARY COMPONENTS -- 4 | -- -- 5 | -- A D A . C O N T A I N E R S . G E N E R I C _ A R R A Y _ S O R T -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | generic 17 | type Index_Type is (<>); 18 | type Element_Type is private; 19 | type Array_Type is array (Index_Type range <>) of Element_Type; 20 | 21 | with function "<" (Left, Right : Element_Type) 22 | return Boolean is <>; 23 | 24 | procedure Ada.Containers.Generic_Array_Sort (Container : in out Array_Type); 25 | 26 | pragma Pure (Ada.Containers.Generic_Array_Sort); 27 | -------------------------------------------------------------------------------- /common/s-fremem.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2018 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | package System.FreeRTOS.Memory is 22 | pragma Preelaborate; 23 | pragma No_Elaboration_Code_All; 24 | 25 | function Malloc 26 | (Size : Natural) return System.Address 27 | with 28 | Import, 29 | Convention => C, 30 | External_Name => "pvPortMalloc"; 31 | 32 | procedure Free (Ptr : System.Address) 33 | with 34 | Import, 35 | Convention => C, 36 | External_Name => "vPortFree"; 37 | 38 | end System.FreeRTOS.Memory; 39 | -------------------------------------------------------------------------------- /common/post-gcc12/a-cgcaso.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT LIBRARY COMPONENTS -- 4 | -- -- 5 | -- ADA.CONTAINERS.GENERIC_CONSTRAINED_ARRAY_SORT -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | generic 17 | type Index_Type is (<>); 18 | type Element_Type is private; 19 | type Array_Type is array (Index_Type) of Element_Type; 20 | 21 | with function "<" (Left, Right : Element_Type) 22 | return Boolean is <>; 23 | 24 | procedure Ada.Containers.Generic_Constrained_Array_Sort 25 | (Container : in out Array_Type); 26 | 27 | pragma Pure (Ada.Containers.Generic_Constrained_Array_Sort); 28 | -------------------------------------------------------------------------------- /common/pre-gcc12/a-cgcaso.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT LIBRARY COMPONENTS -- 4 | -- -- 5 | -- ADA.CONTAINERS.GENERIC_CONSTRAINED_ARRAY_SORT -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | generic 17 | type Index_Type is (<>); 18 | type Element_Type is private; 19 | type Array_Type is array (Index_Type) of Element_Type; 20 | 21 | with function "<" (Left, Right : Element_Type) 22 | return Boolean is <>; 23 | 24 | procedure Ada.Containers.Generic_Constrained_Array_Sort 25 | (Container : in out Array_Type); 26 | 27 | pragma Pure (Ada.Containers.Generic_Constrained_Array_Sort); 28 | -------------------------------------------------------------------------------- /microbit/COPYING.Nordic: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Nordic Semiconductor ASA 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of Nordic Semiconductor ASA nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /test-microbit/accelerometer.adb: -------------------------------------------------------------------------------- 1 | with MMA8653; 2 | with MicroBit.I2C; 3 | with LEDs; 4 | with Ada.Real_Time; 5 | 6 | procedure Accelerometer is 7 | Acc : MMA8653.MMA8653_Accelerometer (Port => MicroBit.I2C.Controller); 8 | begin 9 | if not MicroBit.I2C.Initialized then 10 | MicroBit.I2C.Initialize (S => MicroBit.I2C.S400kbps); 11 | end if; 12 | 13 | if not Acc.Check_Device_Id then 14 | for R in LEDs.Coord'Range loop 15 | for C in LEDs.Coord'Range loop 16 | LEDs.Set_One_LED (R, C); 17 | end loop; 18 | end loop; 19 | delay until Ada.Real_Time.Time_Last; 20 | end if; 21 | 22 | Acc.Configure (MMA8653.Two_G, 23 | MMA8653.High_Resolution, 24 | MMA8653.High_Resolution); 25 | 26 | loop 27 | declare 28 | Detection_Limit : constant := 75; 29 | Data : constant MMA8653.All_Axes_Data := Acc.Read_Data; 30 | use type MMA8653.Axis_Data; 31 | use type Ada.Real_Time.Time; 32 | begin 33 | LEDs.Clear_All_LEDs; 34 | if Data.X > Detection_Limit then 35 | LEDs.Set_One_LED (3, 1); 36 | elsif Data.X < -Detection_Limit then 37 | LEDs.Set_One_LED (3, 5); 38 | elsif Data.Y > Detection_Limit then 39 | LEDs.Set_One_LED (1, 3); 40 | elsif Data.Y < -Detection_Limit then 41 | LEDs.Set_One_LED (5, 3); 42 | else 43 | LEDs.Set_One_LED (3, 3); 44 | end if; 45 | delay until Ada.Real_Time.Clock + Ada.Real_Time.Milliseconds (100); 46 | end; 47 | end loop; 48 | end Accelerometer; 49 | -------------------------------------------------------------------------------- /test-stm32f4/generate_hard_fault.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2017-2021 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | -- This program has no visible functionality; when run under the 20 | -- debugger it will hit a breakpoint when Faulting_Task calls a C 21 | -- function resulting in a divide-by-zero HardFault. 22 | 23 | with Ada.Real_Time; 24 | 25 | pragma Warnings (Off, "is an internal GNAT unit"); 26 | with System.Hardfault_Handling; 27 | pragma Warnings (On, "is an internal GNAT unit"); 28 | pragma Unreferenced (System.Hardfault_Handling); 29 | 30 | with Faulting_Task; 31 | pragma Unreferenced (Faulting_Task); 32 | 33 | procedure Generate_Hard_Fault is 34 | use type Ada.Real_Time.Time; 35 | begin 36 | loop 37 | delay until Ada.Real_Time.Clock + Ada.Real_Time.Seconds (2); 38 | end loop; 39 | end Generate_Hard_Fault; 40 | -------------------------------------------------------------------------------- /arduino-due/COPYING.Atmel: -------------------------------------------------------------------------------- 1 | ============================================================================ 2 | Atmel Microcontroller Software Support 3 | SAM Software Package License 4 | ============================================================================ 5 | Copyright (c) 2013, Atmel Corporation 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following condition is met: 11 | 12 | - Redistributions of source code must retain the above copyright notice, 13 | this list of conditions and the disclaimer below. 14 | 15 | Atmel's name may not be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 19 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 21 | DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | ============================================================================ 29 | -------------------------------------------------------------------------------- /common/s-harhan.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2017-2020 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | package System.Hardfault_Handling is 22 | 23 | -- Normally, we'd mark this unit as preelaborable, but that would 24 | -- mean that the binder-generated code wouldn't reference it, so 25 | -- it wouldn't get referenced at all (because the weak symbol in 26 | -- startup.o would satisfy the link). 27 | 28 | procedure Handler 29 | with 30 | Export, 31 | Convention => Asm, 32 | External_Name => "HardFault_Handler"; 33 | pragma Machine_Attribute (Handler, "naked"); 34 | 35 | end System.Hardfault_Handling; 36 | -------------------------------------------------------------------------------- /common/cortex/s-ftinis.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016-2024 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | -- This function returns True if it is executing in an Interrupt 22 | -- Service Routine. This is the Cortex version. 23 | 24 | with System.Machine_Code; 25 | 26 | separate (System.FreeRTOS.Tasks) 27 | function In_ISR return Boolean 28 | is 29 | IPSR : Interfaces.Unsigned_32; 30 | use type Interfaces.Unsigned_32; 31 | begin 32 | System.Machine_Code.Asm 33 | ("mrs %0, ipsr", 34 | Outputs => Interfaces.Unsigned_32'Asm_Output ("=r", IPSR), 35 | Volatile => True); 36 | return (IPSR and 16#ff#) /= 0; 37 | end In_ISR; 38 | -------------------------------------------------------------------------------- /test-common/so.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2017 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with Ada.Real_Time; 20 | with Ada.Synchronous_Task_Control; 21 | 22 | package body SO is 23 | 24 | The_SO : Ada.Synchronous_Task_Control.Suspension_Object; 25 | 26 | task T is 27 | pragma Task_Name ("so.t"); 28 | end T; 29 | task body T is 30 | begin 31 | loop 32 | Ada.Synchronous_Task_Control.Suspend_Until_True (The_SO); 33 | end loop; 34 | end T; 35 | 36 | task Tick is 37 | pragma Task_Name ("so.tick"); 38 | end Tick; 39 | task body Tick is 40 | use type Ada.Real_Time.Time; 41 | begin 42 | loop 43 | delay until Ada.Real_Time.Clock + Ada.Real_Time.Seconds (2); 44 | Ada.Synchronous_Task_Control.Set_True (The_SO); 45 | end loop; 46 | end Tick; 47 | 48 | end SO; 49 | -------------------------------------------------------------------------------- /common/a-except.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is free software; you can redistribute it and/or modify 4 | -- it under terms of the GNU General Public License as published by 5 | -- the Free Software Foundation; either version 3, or (at your 6 | -- option) any later version. This file is distributed in the hope 7 | -- that it will be useful, but WITHOUT ANY WARRANTY; without even the 8 | -- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 9 | -- PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | with System; 22 | 23 | package body Ada.Exceptions is 24 | 25 | procedure Last_Chance_Handler 26 | (Message : System.Address; Line : Integer) 27 | with 28 | Import, 29 | Convention => C, 30 | External_Name => "__gnat_last_chance_handler", 31 | No_Return; 32 | 33 | procedure Raise_Exception (E : Exception_Id; Message : String := "") 34 | is 35 | pragma Unreferenced (E); 36 | begin 37 | -- pragma Warnings (Off); 38 | Last_Chance_Handler (Message'Address, 0); 39 | -- pragma Warnings (On); 40 | end Raise_Exception; 41 | 42 | end Ada.Exceptions; 43 | -------------------------------------------------------------------------------- /common/last_chance_handler.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 Free Software Foundation, Inc. 2 | // 3 | // GNAT is free software; you can redistribute it and/or modify it under 4 | // terms of the GNU General Public License as published by the Free Soft- 5 | // ware Foundation; either version 3, or (at your option) any later ver- 6 | // sion. GNAT is distributed in the hope that it will be useful, but WITH- 7 | // OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 8 | // or FITNESS FOR A PARTICULAR PURPOSE. 9 | // 10 | // As a special exception under Section 7 of GPL version 3, you are granted 11 | // additional permissions described in the GCC Runtime Library Exception, 12 | // version 3.1, as published by the Free Software Foundation. 13 | // 14 | // You should have received a copy of the GNU General Public License and 15 | // a copy of the GCC Runtime Library Exception along with this program; 16 | // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 17 | // . 18 | // 19 | // This version of last_chance_handler is written in C, because that 20 | // is the interface expected by a-except.adb; and we can do nothing 21 | // but loop. 22 | // 23 | // Note, the function name is exported as a weak symbol, so you can 24 | // write your own version, in Ada if you like, perhaps to output the 25 | // exception message to LCD. 26 | 27 | #include 28 | #include 29 | 30 | __attribute__((weak)) 31 | void __gnat_last_chance_handler(const char *message, int line) { 32 | taskDISABLE_INTERRUPTS(); 33 | vTaskSuspendAll(); 34 | // Loop indefinitely: use the debugger to examine the backtrace. 35 | while (1) {} 36 | } 37 | -------------------------------------------------------------------------------- /common/s-fresem.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | pragma Restrictions (No_Elaboration_Code); 22 | 23 | package System.FreeRTOS.Semaphores is 24 | pragma Preelaborate; 25 | 26 | type Semaphore (<>) is limited private; 27 | type Semaphore_Handle is access all Semaphore; 28 | 29 | function Create_Semaphore return not null Semaphore_Handle; 30 | 31 | procedure Give (The_Semaphore : not null Semaphore_Handle); 32 | 33 | procedure Take (The_Semaphore : not null Semaphore_Handle); 34 | 35 | private 36 | 37 | type Semaphore is null record; 38 | -- Of course it isn't really, but it is opaque to us. 39 | 40 | end System.FreeRTOS.Semaphores; 41 | -------------------------------------------------------------------------------- /common/s-fretcb.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2018 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | package System.FreeRTOS.TCB is 22 | pragma Preelaborate; 23 | pragma No_Elaboration_Code_All; 24 | 25 | -- Requires configUSE_APPLICATION_TASK_TAG to be set in 26 | -- FreeRTOSConfig.h. 27 | 28 | -- Return the parameter saved in the current task's FreeRTOS 29 | -- TCB. In our case, this will be the corresponding ATCB. 30 | function Get_Application_Parameter return System.Address; 31 | 32 | -- Save Parameter in the current task's FreeRTOS TCB. In our case, 33 | -- this will be the corresponding ATCB. 34 | procedure Set_Application_Parameter (Parameter : System.Address); 35 | 36 | end System.FreeRTOS.TCB; 37 | -------------------------------------------------------------------------------- /test-common/last_chance_handler.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016-2018 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | procedure Last_Chance_Handler 20 | (Message : Interfaces.C.Strings.chars_ptr; Line : Integer) 21 | is 22 | pragma Unreferenced (Message, Line); 23 | procedure Disable_Interrupts 24 | with 25 | Import, 26 | Convention => C, 27 | External_Name => "_gnat_disable_interrupts"; 28 | -- procedure Suspend_All_Tasks 29 | -- with 30 | -- Import, 31 | -- Convention => C, 32 | -- External_Name => "vTaskSuspendAll"; 33 | begin 34 | -- TODO: Add in code to dump the info to serial/screen which 35 | -- is obviously board specific. 36 | -- 37 | -- At the moment, use the debugger to examine the backtrace. 38 | Disable_Interrupts; 39 | -- Suspend_All_Tasks; 40 | -- This crashes with STM32F4, FreeRTOS v9 41 | 42 | loop 43 | null; 44 | end loop; 45 | end Last_Chance_Handler; 46 | -------------------------------------------------------------------------------- /common/a-except.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2018 Free Software Foundation, Inc. 2 | -- 3 | -- This specification is derived from the Ada Reference Manual for 4 | -- use with GNAT. The copyright notice above, and the license 5 | -- provisions that follow apply solely to the contents of the part 6 | -- following the private keyword. 7 | -- 8 | -- This file is free software; you can redistribute it and/or modify 9 | -- it under terms of the GNU General Public License as published by 10 | -- the Free Software Foundation; either version 3, or (at your 11 | -- option) any later version. This file is distributed in the hope 12 | -- that it will be useful, but WITHOUT ANY WARRANTY; without even the 13 | -- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 14 | -- PURPOSE. 15 | -- 16 | -- As a special exception under Section 7 of GPL version 3, you are 17 | -- granted additional permissions described in the GCC Runtime 18 | -- Library Exception, version 3.1, as published by the Free Software 19 | -- Foundation. 20 | -- 21 | -- You should have received a copy of the GNU General Public License 22 | -- and a copy of the GCC Runtime Library Exception along with this 23 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 24 | -- If not, see . 25 | 26 | package Ada.Exceptions is 27 | pragma Preelaborate; 28 | pragma No_Elaboration_Code_All; 29 | 30 | type Exception_Id is private 31 | with 32 | Preelaborable_Initialization; 33 | 34 | Null_Id : constant Exception_Id; 35 | 36 | procedure Raise_Exception (E : Exception_Id; Message : String := "") 37 | with 38 | No_Return; 39 | 40 | private 41 | 42 | type Exception_Id is new Integer; 43 | Null_Id : constant Exception_Id := -1; 44 | 45 | end Ada.Exceptions; 46 | -------------------------------------------------------------------------------- /common/riscv/s-ftinis.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2024 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | -- This function returns True if it is executing in an Interrupt 22 | -- Service Routine. This is the RISC-V version. 23 | 24 | with System.Machine_Code; 25 | 26 | separate (System.FreeRTOS.Tasks) 27 | function In_ISR return Boolean 28 | is 29 | MIE : Interfaces.Unsigned_32; 30 | use type Interfaces.Unsigned_32; 31 | begin 32 | -- This is a bit of an assumption! Certainly true for the 33 | -- ESP32-H2, so long as no one tries implementing nested 34 | -- interrupts. Don't know what standard RISC-V would need. 35 | System.Machine_Code.Asm 36 | ("csrr %0, mie", 37 | Outputs => Interfaces.Unsigned_32'Asm_Output ("=r", MIE), 38 | Volatile => True); 39 | return MIE = 0; 40 | end In_ISR; 41 | -------------------------------------------------------------------------------- /test-arduino-due/watchdog_check.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | -- This package is only to be used to check the ability to override 20 | -- the default arduino-due runtime behaviour, which is to disable the 21 | -- watchdog. 22 | 23 | package Watchdog_Check is 24 | 25 | -- The RTS includes (in startup.adb) a version of this procedure 26 | -- with pragma Weak_External. This means that if the user code 27 | -- includes a procedure with this profile it will be linked 28 | -- instead of the RTS version. Since the RTS version disables the 29 | -- watchdog, and this version does not, the watchdog will be 30 | -- running, and after 16 seconds the MCU will reset (and the 31 | -- orange LED will blink rapidly 5 times before reverting to its 32 | -- once-per-second behaviour). 33 | procedure Initialize_Watchdog 34 | is null 35 | with 36 | Export, 37 | Convention => Ada, 38 | External_Name => "initialize_watchdog"; 39 | 40 | end Watchdog_Check; 41 | -------------------------------------------------------------------------------- /test-microbit/events.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2020-2021 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with Event_Support; 20 | with Ada.Real_Time.Timing_Events; 21 | 22 | pragma Warnings (Off, "internal GNAT unit"); 23 | with System.Hardfault_Handling; 24 | pragma Warnings (On, "internal GNAT unit"); 25 | pragma Unreferenced (System.Hardfault_Handling); 26 | 27 | procedure Events is 28 | -- Environment_Task_Storage_Size : constant Natural := 1536 29 | -- with 30 | -- Export, 31 | -- Convention => Ada, 32 | -- External_Name => "_environment_task_storage_size"; 33 | -- Default_Initial_Stack : constant Natural := 4096 34 | -- with 35 | -- Export, 36 | -- Convention => Ada, 37 | -- External_Name => "_default_initial_stack"; 38 | begin 39 | Event_Support.LED_Event_Handling.Handle 40 | (Ada.Real_Time.Timing_Events.Timing_Event (Event_Support.Slow)); 41 | Event_Support.Handler 42 | (Ada.Real_Time.Timing_Events.Timing_Event (Event_Support.Quick)); 43 | 44 | delay until Ada.Real_Time.Time_Last; 45 | end Events; 46 | -------------------------------------------------------------------------------- /common/a-string.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . S T R I N G S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | package Ada.Strings is 17 | pragma Pure; 18 | 19 | Space : constant Character := ' '; 20 | Wide_Space : constant Wide_Character := ' '; 21 | 22 | -- The following declaration is for Ada 2005 (AI-285) 23 | 24 | Wide_Wide_Space : constant Wide_Wide_Character := ' '; 25 | pragma Ada_05 (Wide_Wide_Space); 26 | 27 | Length_Error, Pattern_Error, Index_Error, Translation_Error : exception; 28 | 29 | type Alignment is (Left, Right, Center); 30 | type Truncation is (Left, Right, Error); 31 | type Membership is (Inside, Outside); 32 | type Direction is (Forward, Backward); 33 | type Trim_End is (Left, Right, Both); 34 | 35 | end Ada.Strings; 36 | -------------------------------------------------------------------------------- /demos-arduino-due/first.gpr: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2019 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | project First is 20 | for Main use ("first.adb"); 21 | for Target use "arm-eabi"; 22 | for Runtime ("ada") use project'Project_Dir & "../local/arduino-due"; 23 | for Object_Dir use ".build"; 24 | for Exec_Dir use "."; 25 | for Create_Missing_Dirs use "true"; 26 | package Builder is 27 | for Switches (others) use 28 | ( 29 | "-g", 30 | "-Og", 31 | "--create-map-file" 32 | ); 33 | for Global_Compilation_Switches ("ada") use 34 | ( 35 | "-ffunction-sections", 36 | "-fdata-sections" 37 | ); 38 | end Builder; 39 | package Compiler is 40 | for Default_Switches ("ada") use 41 | ( 42 | "-gnatqQafoy", 43 | "-gnatwaL", 44 | "-gnatwaL.X"); 45 | end Compiler; 46 | package Linker is 47 | for Default_Switches ("ada") use ("-Wl,-gc-sections"); 48 | for Map_File_Option use "-Wl,-Map," & project'Project_Dir; 49 | end Linker; 50 | end First; 51 | -------------------------------------------------------------------------------- /test-common/dispatching.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2017, 2020 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with Ada.Real_Time; 20 | 21 | package body Dispatching is 22 | 23 | function Basis (B : Base) return Character is ('a'); 24 | 25 | function Value (D : Derived) return Integer is (42); 26 | 27 | task T is 28 | pragma Task_Name ("dispatching.t"); 29 | end T; 30 | 31 | task body T is 32 | type Base_P is access Base'Class; 33 | D : constant Base_P := new Derived; 34 | begin 35 | loop 36 | declare 37 | C : constant Character := D.Basis; 38 | V : constant Integer := D.Value; 39 | begin 40 | pragma Assert (C = 'a', "wrong C"); 41 | pragma Assert (V = 42, "wrong V"); 42 | null; 43 | end; 44 | declare 45 | Next : Ada.Real_Time.Time := Ada.Real_Time.Clock; 46 | use type Ada.Real_Time.Time; 47 | begin 48 | Next := Next + Ada.Real_Time.Milliseconds (500); 49 | delay until Next; 50 | end; 51 | end loop; 52 | end T; 53 | 54 | end Dispatching; 55 | -------------------------------------------------------------------------------- /common/a-iteint.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT LIBRARY COMPONENTS -- 4 | -- -- 5 | -- A D A . I T E R A T O R . I N T E R F A C E S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | generic 17 | type Cursor; 18 | with function Has_Element (Position : Cursor) return Boolean; 19 | pragma Unreferenced (Has_Element); 20 | 21 | package Ada.Iterator_Interfaces is 22 | pragma Pure; 23 | 24 | type Forward_Iterator is limited interface; 25 | 26 | function First 27 | (Object : Forward_Iterator) return Cursor is abstract; 28 | function Next 29 | (Object : Forward_Iterator; 30 | Position : Cursor) return Cursor is abstract; 31 | 32 | type Reversible_Iterator is limited interface and Forward_Iterator; 33 | 34 | function Last 35 | (Object : Reversible_Iterator) return Cursor is abstract; 36 | function Previous 37 | (Object : Reversible_Iterator; 38 | Position : Cursor) return Cursor is abstract; 39 | end Ada.Iterator_Interfaces; 40 | -------------------------------------------------------------------------------- /common/math/a-numeri.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . N U M E R I C S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | 16 | package Ada.Numerics is 17 | pragma Pure; 18 | 19 | Argument_Error : exception; 20 | 21 | Pi : constant := 22 | 3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37511; 23 | 24 | -- ["03C0"] : constant := Pi; 25 | -- This is the Greek letter Pi (for Ada 2005 AI-388). Note that it is 26 | -- conforming to have this constant present even in Ada 95 mode, as there 27 | -- is no way for a normal mode Ada 95 program to reference this identifier. 28 | -- ???This is removed for now, because nobody uses it, and it causes 29 | -- trouble for tools other than the compiler. If people want to use the 30 | -- Greek letter in their programs, they can easily define it themselves. 31 | 32 | e : constant := 33 | 2.71828_18284_59045_23536_02874_71352_66249_77572_47093_69996; 34 | 35 | end Ada.Numerics; 36 | -------------------------------------------------------------------------------- /test-common/strings.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2017 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with Ada.Real_Time; 20 | 21 | package body Strings is 22 | 23 | function Substring (S : String) return String; 24 | 25 | task T is 26 | pragma Task_Name ("strings.t"); 27 | end T; 28 | 29 | task body T is 30 | begin 31 | for J in 1 .. 20 loop 32 | declare 33 | S : constant String 34 | := Substring ("foo") with Unreferenced; 35 | begin 36 | null; 37 | end; 38 | declare 39 | S : constant String 40 | := Substring ("hello me hearties") with Unreferenced; 41 | begin 42 | null; 43 | end; 44 | end loop; 45 | declare 46 | Next : Ada.Real_Time.Time := Ada.Real_Time.Clock; 47 | use type Ada.Real_Time.Time; 48 | begin 49 | loop 50 | Next := Next + Ada.Real_Time.Milliseconds (500); 51 | delay until Next; 52 | end loop; 53 | end; 54 | end T; 55 | 56 | function Substring (S : String) return String is 57 | begin 58 | return S (S'First .. Positive'Min (10, S'Length) + S'First - 1); 59 | end Substring; 60 | 61 | end Strings; 62 | -------------------------------------------------------------------------------- /test-microbit/event_support.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2020 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with LEDs; 20 | with Ada.Real_Time.Timing_Events; 21 | package Event_Support is 22 | 23 | subtype Milliseconds is Natural; 24 | 25 | type LED_Event is new Ada.Real_Time.Timing_Events.Timing_Event 26 | with record 27 | Row : LEDs.Coord; 28 | Col : LEDs.Coord; 29 | Period : Milliseconds; 30 | State : Boolean; 31 | end record; 32 | 33 | Slow : LED_Event := 34 | (Ada.Real_Time.Timing_Events.Timing_Event 35 | with 4, 5, 5000, True); 36 | Quick : LED_Event := 37 | (Ada.Real_Time.Timing_Events.Timing_Event 38 | with 1, 1, 2000, True); 39 | 40 | type LEDs_Status is array (LEDs.Coord, LEDs.Coord) of Boolean; 41 | -- (Row, Col) 42 | 43 | protected LED_Event_Handling is 44 | pragma Interrupt_Priority; 45 | procedure Handle 46 | (Event : in out Ada.Real_Time.Timing_Events.Timing_Event); 47 | private 48 | Set_LEDs : LEDs_Status := (others => (others => False)); 49 | end LED_Event_Handling; 50 | 51 | Handler : constant Ada.Real_Time.Timing_Events.Timing_Event_Handler 52 | := LED_Event_Handling.Handle'Access; 53 | 54 | end Event_Support; 55 | -------------------------------------------------------------------------------- /common/s-fretcb.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | package body System.FreeRTOS.TCB is 22 | 23 | function Get_Application_Parameter return System.Address is 24 | function xTaskGetApplicationTaskTag 25 | (xTask : System.Address) return System.Address 26 | with 27 | Import, 28 | Convention => C, 29 | External_Name => "xTaskGetApplicationTaskTag"; 30 | begin 31 | return xTaskGetApplicationTaskTag (System.Null_Address); 32 | end Get_Application_Parameter; 33 | 34 | procedure Set_Application_Parameter (Parameter : System.Address) is 35 | procedure vTaskSetApplicationTaskTag (xTask : System.Address; 36 | pxHookFunction : System.Address) 37 | with 38 | Import, 39 | Convention => C, 40 | External_Name => "vTaskSetApplicationTaskTag"; 41 | begin 42 | vTaskSetApplicationTaskTag (System.Null_Address, Parameter); 43 | end Set_Application_Parameter; 44 | 45 | end System.FreeRTOS.TCB; 46 | -------------------------------------------------------------------------------- /test-microbit/circle.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2018-2021 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | pragma Warnings (Off, "internal GNAT unit"); 20 | with System.Hardfault_Handling; 21 | pragma Warnings (On, "internal GNAT unit"); 22 | pragma Unreferenced (System.Hardfault_Handling); 23 | 24 | with Lights; 25 | pragma Unreferenced (Lights); 26 | 27 | with Ada.Real_Time; 28 | 29 | procedure Circle is 30 | 31 | -- These are the default values of the stack control parameters. 32 | 33 | -- For the environment task. 34 | -- Environment_Task_Storage_Size : constant Natural := 1536 35 | -- with 36 | -- Export, 37 | -- Convention => Ada, 38 | -- External_Name => "_environment_task_storage_size"; 39 | 40 | -- For ordinary tasks. 41 | -- Default_Storage_Size : constant Natural := 1024 42 | -- with 43 | -- Export, 44 | -- Convention => Ada, 45 | -- External_Name => "_default_storage_size"; 46 | 47 | -- For the initial stack (also used for interrupt programs). 48 | -- Default_Initial_Stack : constant Natural := 1024 49 | -- with 50 | -- Export, 51 | -- Convention => Ada, 52 | -- External_Name => "_default_initial_stack"; 53 | 54 | begin 55 | delay until Ada.Real_Time.Time_Last; 56 | end Circle; 57 | -------------------------------------------------------------------------------- /test-arduino-due/testbed.gpr: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016-2018 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | project Testbed is 20 | 21 | for Main use ("testbed.adb"); 22 | for Source_Dirs use (".", "../test-common"); 23 | for Object_Dir use ".build"; 24 | for Exec_Dir use "."; 25 | for Target use "arm-eabi"; 26 | for Runtime ("ada") use project'Project_Dir & "../local/arduino-due"; 27 | 28 | package Builder is 29 | for Global_Compilation_Switches ("ada") use 30 | ( 31 | "-g", 32 | "-O0", 33 | "-ffunction-sections", 34 | "-fdata-sections" 35 | ); 36 | for Switches ("ada") use ("--create-map-file"); 37 | end Builder; 38 | 39 | package Compiler is 40 | for Default_Switches ("ada") use 41 | ( 42 | "-gnatqQafoy", 43 | "-gnatwaL.X" 44 | ); 45 | end Compiler; 46 | 47 | package Linker is 48 | for Default_Switches ("ada") use ("-Wl,-gc-sections"); 49 | for Map_File_Option use "-Wl,-Map," & project'Project_Dir; 50 | end Linker; 51 | 52 | package IDE is 53 | for Connection_Tool use "gdbserver-sam3x8e"; 54 | for Program_Host use "*:2331"; -- using Segger j-link 55 | for Communication_Protocol use "remote"; 56 | end IDE; 57 | 58 | end Testbed; 59 | -------------------------------------------------------------------------------- /test-stm32f429i/testbed.gpr: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016-2021 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with "Ada_Drivers_Library/ada_drivers_library"; 20 | 21 | project Testbed is 22 | 23 | for Main use ("testbed.adb"); 24 | for Source_Dirs use (".", "../test-common"); 25 | for Object_Dir use ".build"; 26 | for Exec_Dir use "."; 27 | for Target use "arm-eabi"; 28 | for Runtime ("ada") use project'Project_Dir & "../local/stm32f429i"; 29 | 30 | package Builder is 31 | for Global_Compilation_Switches ("ada") use 32 | ( 33 | "-g", 34 | "-O0", 35 | "-ffunction-sections", 36 | "-fdata-sections" 37 | ); 38 | for Switches ("ada") use ("--create-map-file"); 39 | end Builder; 40 | 41 | package Compiler is 42 | for Default_Switches ("ada") use 43 | ( 44 | "-gnatqQafoy", 45 | "-gnatwaL.X" 46 | ); 47 | end Compiler; 48 | 49 | package Linker is 50 | for Default_Switches ("ada") use ("-Wl,-gc-sections"); 51 | for Map_File_Option use "-Wl,-Map," & project'Project_Dir; 52 | end Linker; 53 | 54 | package IDE is 55 | for Connection_Tool use "/usr/local/bin/st-util"; 56 | for Program_Host use "*:4242"; 57 | for Communication_Protocol use "remote"; 58 | end IDE; 59 | 60 | end Testbed; 61 | -------------------------------------------------------------------------------- /test-stm32f4/faulting_task.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2017 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with Ada.Real_Time; 20 | with Interfaces; 21 | with System; 22 | 23 | package body Faulting_Task is 24 | 25 | task T; 26 | task body T is 27 | 28 | -- Configuration and Control Register 29 | CCR : Interfaces.Unsigned_32 30 | with 31 | Import, 32 | Convention => Ada, 33 | Address => System'To_Address (16#E000ED14#), 34 | Volatile_Full_Access; 35 | 36 | use type Interfaces.Unsigned_32; 37 | 38 | -- This is written in C because GNAT resists all Ada attempts 39 | -- to actually divide by zero, instead raising CE (actually, 40 | -- calling Last_Chance_Handler). 41 | function Div (L, R : Integer) return Integer 42 | with 43 | Import, 44 | Convention => C, 45 | External_Name => "div"; 46 | 47 | Result : Integer with Volatile, Warnings => Off; 48 | 49 | use type Ada.Real_Time.Time; 50 | begin 51 | CCR := CCR or 16#0000_0010#; -- DIV_0_TRP 52 | 53 | Result := Div (0, 10); -- OK 54 | Result := Div (10, 0); -- Fails 55 | 56 | -- Loop indefinitely, in case the fault doesn't actually happen 57 | loop 58 | delay until Ada.Real_Time.Clock + Ada.Real_Time.Seconds (2); 59 | end loop; 60 | end T; 61 | 62 | end Faulting_Task; 63 | -------------------------------------------------------------------------------- /common/a-sytaco.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | package body Ada.Synchronous_Task_Control is 22 | 23 | procedure Set_True (S : in out Suspension_Object) is 24 | begin 25 | S.Set_True; 26 | end Set_True; 27 | 28 | procedure Set_False (S : in out Suspension_Object) is 29 | begin 30 | S.Set_False; 31 | end Set_False; 32 | 33 | function Current_State (S : Suspension_Object) return Boolean is 34 | (S.Current_State); 35 | 36 | procedure Suspend_Until_True (S : in out Suspension_Object) is 37 | begin 38 | S.Suspend_Until_True; 39 | end Suspend_Until_True; 40 | 41 | protected body Suspension_Object is 42 | 43 | procedure Set_True is 44 | begin 45 | State := True; 46 | end Set_True; 47 | 48 | procedure Set_False is 49 | begin 50 | State := False; 51 | end Set_False; 52 | 53 | function Current_State return Boolean is (State); 54 | 55 | entry Suspend_Until_True when State is 56 | begin 57 | State := False; 58 | end Suspend_Until_True; 59 | 60 | end Suspension_Object; 61 | 62 | end Ada.Synchronous_Task_Control; 63 | -------------------------------------------------------------------------------- /common/s-freert.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2018 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | with Interfaces; 22 | 23 | package System.FreeRTOS is 24 | pragma Pure; 25 | pragma No_Elaboration_Code_All; 26 | 27 | -- from portmacro.h, 28 | -- portBASE_TYPE is long 29 | 30 | type Base_Type is new Interfaces.Integer_32; 31 | type Unsigned_Base_Type is new Interfaces.Unsigned_32; 32 | 33 | subtype Tick_Type is Unsigned_Base_Type; 34 | 35 | Max_Delay : constant Tick_Type := 16#ffff_ffff#; 36 | 37 | -- From projdefs.h. 38 | 39 | subtype Status_Code is Base_Type; 40 | 41 | Fail : constant Status_Code := 0; 42 | Pass : constant Status_Code := 1; 43 | -- Queue_Empty : constant Status_Code := 0; 44 | -- Queue_Full : constant Status_Code := 0; 45 | -- Could_Not_Allocate_Required_Memory : constant Status_Code := -1; 46 | -- No_Task_To_Run : constant Status_Code := -2; 47 | -- Queue_Blocked : constant Status_Code := -4; 48 | -- Queue_Yield : constant Status_Code := -5; 49 | 50 | end System.FreeRTOS; 51 | -------------------------------------------------------------------------------- /common/common.gpr: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2018-2024 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | abstract project Common is 20 | 21 | type Compiler_Release is 22 | ("gcc6", "gnat-gpl-2017", "gcc7", "gcc8", "gnat-ce-2020", 23 | "gcc11", "gcc12"); 24 | 25 | -- We need to cope with changes to tasking and tag code between 26 | -- compiler releases. 27 | Release : Compiler_Release := external ("RELEASE", "gcc12"); 28 | Release_Path := Release; 29 | case Release is 30 | when "gcc11" => 31 | Release_Path := "gnat-ce-2020"; 32 | when others => 33 | null; 34 | end case; 35 | -- We also need to cope with the Ada2022 changes to 'Image code 36 | -- and the new aggregate syntax, which is the same up to GCC12. 37 | Image_Path := ""; 38 | case Release is 39 | when "gcc12" => 40 | Image_Path := "post-gcc12"; 41 | when others => 42 | Image_Path := "pre-gcc12"; 43 | end case; 44 | 45 | type Architecture is ("cortex", "riscv"); 46 | Arch : Architecture := external ("ARCH", "cortex"); 47 | 48 | type Install_Locally is ("yes", "no"); 49 | Local : Install_Locally := external ("INSTALL_LOCALLY", "yes"); 50 | 51 | Paths := (project'Project_Dir, 52 | project'Project_Dir & "math", 53 | project'Project_Dir & Release_Path, 54 | project'Project_Dir & Image_Path, 55 | project'Project_Dir & Arch); 56 | 57 | end Common; 58 | -------------------------------------------------------------------------------- /test-microbit/event_support.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2020 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | package body Event_Support is 20 | 21 | protected body LED_Event_Handling is 22 | 23 | procedure Handle 24 | (Event : in out Ada.Real_Time.Timing_Events.Timing_Event) 25 | is 26 | Our_Event : LED_Event 27 | renames LED_Event 28 | (Ada.Real_Time.Timing_Events.Timing_Event'Class (Event)); 29 | New_State : constant Boolean := Our_Event.State; 30 | Flash : constant Milliseconds := 250; 31 | use type Ada.Real_Time.Time; 32 | begin 33 | Set_LEDs (Our_Event.Row, Our_Event.Col) := New_State; 34 | Our_Event.State := not New_State; 35 | LEDs.Clear_All_LEDs; 36 | for R in LEDs.Coord loop 37 | for C in LEDs.Coord loop 38 | if Set_LEDs (R, C) then 39 | LEDs.Set_One_LED (R, C); 40 | end if; 41 | end loop; 42 | end loop; 43 | -- turn off after Flash, turn on after the event's Period 44 | -- minus Flash 45 | Event.Set_Handler 46 | (Handler => Handler, 47 | At_Time => Ada.Real_Time.Clock 48 | + Ada.Real_Time.Milliseconds (if New_State 49 | then Flash 50 | else Our_Event.Period - Flash)); 51 | end Handle; 52 | 53 | end LED_Event_Handling; 54 | 55 | end Event_Support; 56 | -------------------------------------------------------------------------------- /demos-arduino-due/debounce.gpr: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016, 2019 Free Software Foundation, Inc. 2 | 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | project Debounce is 20 | 21 | type Implementation_Type is ("software", "hardware"); 22 | Implementation : Implementation_Type := external ("IMPL", "software"); 23 | 24 | for Main use ("debounce.adb"); 25 | for Target use "arm-eabi"; 26 | for Runtime ("ada") use project'Project_Dir & "../local/arduino-due"; 27 | for Object_Dir use ".build-" & Implementation; 28 | for Exec_Dir use "."; 29 | for Create_Missing_Dirs use "true"; 30 | 31 | package Naming is 32 | for Body ("Debounce_Impl") use "debounce_" & Implementation & ".adb"; 33 | end Naming; 34 | 35 | package Builder is 36 | for Executable ("debounce.adb") use "debounce_" & Implementation; 37 | for Switches (others) use 38 | ( 39 | "-g", 40 | "-Og" 41 | ); 42 | for Global_Compilation_Switches ("ada") use 43 | ( 44 | "-ffunction-sections", 45 | "-fdata-sections" 46 | ); 47 | end Builder; 48 | package Compiler is 49 | for Default_Switches ("ada") use 50 | ( 51 | "-gnatqQafoy", 52 | "-gnatwaL", 53 | "-gnatwaL.X"); 54 | end Compiler; 55 | package Linker is 56 | for Default_Switches ("ada") use 57 | ( 58 | "-Wl,-gc-sections", 59 | "-Wl,-Map," 60 | & project'Project_Dir 61 | & "/" & Builder'Executable ("debounce.adb") 62 | & ".map" 63 | ); 64 | end Linker; 65 | end Debounce; 66 | -------------------------------------------------------------------------------- /common/s-freque.ads: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | pragma Restrictions (No_Elaboration_Code); 22 | 23 | package System.FreeRTOS.Queues is 24 | pragma Preelaborate; 25 | 26 | type Queue (<>) is private; 27 | type Queue_Handle is access all Queue; 28 | 29 | generic 30 | type Item is private; 31 | package Generic_Queues is 32 | 33 | function Create (Length : Positive) return not null Queue_Handle; 34 | 35 | procedure Send (To : not null Queue_Handle; 36 | The_Item : Item; 37 | Ticks_To_Wait : Natural := 0); 38 | -- Ticks_To_Wait of 0 means "until there is room" 39 | 40 | procedure Send_From_ISR 41 | (To : not null Queue_Handle; 42 | The_Item : Item); 43 | 44 | procedure Overwrite (To : not null Queue_Handle; 45 | The_Item : Item); 46 | -- Only valid for Queues of length 1. 47 | 48 | function Read (From : not null Queue_Handle; 49 | Ticks_To_Wait : Natural := 0) return Item; 50 | -- Ticks_To_Wait of 0 means "until there is something to read" 51 | 52 | end Generic_Queues; 53 | 54 | private 55 | 56 | type Queue is null record; 57 | -- Of course it isn't really, but it is opaque to us. 58 | 59 | end System.FreeRTOS.Queues; 60 | -------------------------------------------------------------------------------- /test-microbit/tests.gpr: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2018-2023 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada package. 4 | -- 5 | -- The FreeRTOS-Ada package is free software; you can redistribute 6 | -- it and/or modify it under the terms of the GNU General Public 7 | -- License as published by the Free Software Foundation; either 8 | -- version 3 of the License, or (at your option) any later version. 9 | -- 10 | -- This program is distributed in the hope that it will be useful, 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | -- General Public License for more details. 14 | -- 15 | -- You should have received a copy of the GNU General Public License 16 | -- along with this program; see the file COPYING3. If not, see 17 | -- . 18 | 19 | with "Ada_Drivers_Library/ada_drivers_library"; 20 | 21 | project Tests is 22 | 23 | for Main use ("circle.adb", 24 | "events.adb", 25 | "seconds.adb", 26 | "accelerometer.adb"); 27 | for Languages use ("Ada"); 28 | for Source_Dirs use (".", "../test-common"); 29 | for Object_Dir use ".build"; 30 | for Exec_Dir use "."; 31 | for Target use "arm-eabi"; 32 | for Runtime ("ada") use "../local/microbit"; 33 | 34 | package Builder is 35 | for Global_Compilation_Switches ("ada") use 36 | ( 37 | "-g", 38 | "-O0", 39 | "-ffunction-sections", 40 | "-fdata-sections" 41 | ); 42 | for Global_Compilation_Switches ("c") use 43 | ( 44 | "-g", 45 | "-O0", 46 | "-ffunction-sections", 47 | "-fdata-sections" 48 | ); 49 | for Switches ("ada") use ("--create-map-file"); 50 | end Builder; 51 | 52 | package Compiler is 53 | for Default_Switches ("c") use ("-g", "-O0"); 54 | for Default_Switches ("ada") use ("-gnatqQafoy", "-gnatwaL.X"); 55 | for Switches ("last_chance_handler.adb") use 56 | Compiler'Default_Switches ("ada") & "-O0"; 57 | end Compiler; 58 | 59 | package Linker is 60 | for Default_Switches ("ada") use ("-g", "-Wl,-gc-sections"); 61 | for Map_File_Option use "-Wl,-Map," & project'Project_Dir; 62 | end Linker; 63 | 64 | package IDE is 65 | for Connection_Tool use "pyocd-gdbserver"; 66 | for Program_Host use "*:3333"; 67 | for Communication_Protocol use "remote"; 68 | end IDE; 69 | 70 | end Tests; 71 | -------------------------------------------------------------------------------- /common/gcc6/s-secsta.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | with System.Tasking; 22 | 23 | package body System.Secondary_Stack is 24 | 25 | function Get_Current_Stack return Stack_Ptr is 26 | (System.Tasking.Self.Secondary_Stack); 27 | 28 | -- procedure SS_Init 29 | -- (Stk : in out Address; 30 | -- Size : Natural) is 31 | -- begin 32 | -- null; 33 | -- end SS_Init; 34 | 35 | procedure SS_Allocate 36 | (Addr : out System.Address; 37 | Storage_Size : System.Storage_Elements.Storage_Count) is 38 | use type System.Parameters.Size_Type; 39 | 40 | Current_Stack : constant Stack_Ptr := Get_Current_Stack; 41 | 42 | Aligned_Size : constant System.Parameters.Size_Type := 43 | ((System.Parameters.Size_Type (Storage_Size) 44 | + Standard'Maximum_Alignment - 1) 45 | / Standard'Maximum_Alignment) 46 | * Standard'Maximum_Alignment; 47 | begin 48 | if Current_Stack.Top + Aligned_Size > Current_Stack.Size + 1 then 49 | raise Storage_Error; 50 | end if; 51 | 52 | Addr := Current_Stack.Mem (Current_Stack.Top)'Address; 53 | Current_Stack.Top := Current_Stack.Top + Aligned_Size; 54 | end SS_Allocate; 55 | 56 | function SS_Mark return Mark_Id is 57 | begin 58 | return Mark_Id (Get_Current_Stack.Top); 59 | end SS_Mark; 60 | 61 | procedure SS_Release (M : Mark_Id) is 62 | begin 63 | Get_Current_Stack.Top := System.Parameters.Size_Type (M); 64 | end SS_Release; 65 | 66 | end System.Secondary_Stack; 67 | -------------------------------------------------------------------------------- /common/gcc7/s-secsta.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | with System.Tasking; 22 | 23 | package body System.Secondary_Stack is 24 | 25 | function Get_Current_Stack return Stack_Ptr is 26 | (System.Tasking.Self.Secondary_Stack); 27 | 28 | -- procedure SS_Init 29 | -- (Stk : in out Address; 30 | -- Size : Natural) is 31 | -- begin 32 | -- null; 33 | -- end SS_Init; 34 | 35 | procedure SS_Allocate 36 | (Addr : out System.Address; 37 | Storage_Size : System.Storage_Elements.Storage_Count) is 38 | use type System.Parameters.Size_Type; 39 | 40 | Current_Stack : constant Stack_Ptr := Get_Current_Stack; 41 | 42 | Aligned_Size : constant System.Parameters.Size_Type := 43 | ((System.Parameters.Size_Type (Storage_Size) 44 | + Standard'Maximum_Alignment - 1) 45 | / Standard'Maximum_Alignment) 46 | * Standard'Maximum_Alignment; 47 | begin 48 | if Current_Stack.Top + Aligned_Size > Current_Stack.Size + 1 then 49 | raise Storage_Error; 50 | end if; 51 | 52 | Addr := Current_Stack.Mem (Current_Stack.Top)'Address; 53 | Current_Stack.Top := Current_Stack.Top + Aligned_Size; 54 | end SS_Allocate; 55 | 56 | function SS_Mark return Mark_Id is 57 | begin 58 | return Mark_Id (Get_Current_Stack.Top); 59 | end SS_Mark; 60 | 61 | procedure SS_Release (M : Mark_Id) is 62 | begin 63 | Get_Current_Stack.Top := System.Parameters.Size_Type (M); 64 | end SS_Release; 65 | 66 | end System.Secondary_Stack; 67 | -------------------------------------------------------------------------------- /common/gcc12/s-secsta.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016-2017 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | with System.Tasking; 22 | 23 | package body System.Secondary_Stack is 24 | 25 | function Get_Current_Stack return SS_Stack_Ptr is 26 | (System.Tasking.Self.Secondary_Stack); 27 | 28 | -- procedure SS_Init 29 | -- (Stk : in out Address; 30 | -- Size : Natural) is 31 | -- begin 32 | -- null; 33 | -- end SS_Init; 34 | 35 | procedure SS_Allocate 36 | (Addr : out System.Address; 37 | Storage_Size : System.Storage_Elements.Storage_Count) is 38 | use type System.Parameters.Size_Type; 39 | 40 | Current_Stack : constant SS_Stack_Ptr := Get_Current_Stack; 41 | 42 | Aligned_Size : constant System.Parameters.Size_Type := 43 | ((System.Parameters.Size_Type (Storage_Size) 44 | + Standard'Maximum_Alignment - 1) 45 | / Standard'Maximum_Alignment) 46 | * Standard'Maximum_Alignment; 47 | begin 48 | if Current_Stack.Top + Aligned_Size > Current_Stack.Size + 1 then 49 | raise Storage_Error; 50 | end if; 51 | 52 | Addr := Current_Stack.Mem (Current_Stack.Top)'Address; 53 | Current_Stack.Top := Current_Stack.Top + Aligned_Size; 54 | end SS_Allocate; 55 | 56 | function SS_Mark return Mark_Id is 57 | begin 58 | return Mark_Id (Get_Current_Stack.Top); 59 | end SS_Mark; 60 | 61 | procedure SS_Release (M : Mark_Id) is 62 | begin 63 | Get_Current_Stack.Top := System.Parameters.Size_Type (M); 64 | end SS_Release; 65 | 66 | end System.Secondary_Stack; 67 | -------------------------------------------------------------------------------- /common/gcc8/s-secsta.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016-2017 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | with System.Tasking; 22 | 23 | package body System.Secondary_Stack is 24 | 25 | function Get_Current_Stack return SS_Stack_Ptr is 26 | (System.Tasking.Self.Secondary_Stack); 27 | 28 | -- procedure SS_Init 29 | -- (Stk : in out Address; 30 | -- Size : Natural) is 31 | -- begin 32 | -- null; 33 | -- end SS_Init; 34 | 35 | procedure SS_Allocate 36 | (Addr : out System.Address; 37 | Storage_Size : System.Storage_Elements.Storage_Count) is 38 | use type System.Parameters.Size_Type; 39 | 40 | Current_Stack : constant SS_Stack_Ptr := Get_Current_Stack; 41 | 42 | Aligned_Size : constant System.Parameters.Size_Type := 43 | ((System.Parameters.Size_Type (Storage_Size) 44 | + Standard'Maximum_Alignment - 1) 45 | / Standard'Maximum_Alignment) 46 | * Standard'Maximum_Alignment; 47 | begin 48 | if Current_Stack.Top + Aligned_Size > Current_Stack.Size + 1 then 49 | raise Storage_Error; 50 | end if; 51 | 52 | Addr := Current_Stack.Mem (Current_Stack.Top)'Address; 53 | Current_Stack.Top := Current_Stack.Top + Aligned_Size; 54 | end SS_Allocate; 55 | 56 | function SS_Mark return Mark_Id is 57 | begin 58 | return Mark_Id (Get_Current_Stack.Top); 59 | end SS_Mark; 60 | 61 | procedure SS_Release (M : Mark_Id) is 62 | begin 63 | Get_Current_Stack.Top := System.Parameters.Size_Type (M); 64 | end SS_Release; 65 | 66 | end System.Secondary_Stack; 67 | -------------------------------------------------------------------------------- /common/gnat-gpl-2017/s-secsta.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | with System.Tasking; 22 | 23 | package body System.Secondary_Stack is 24 | 25 | function Get_Current_Stack return Stack_Ptr is 26 | (System.Tasking.Self.Secondary_Stack); 27 | 28 | -- procedure SS_Init 29 | -- (Stk : in out Address; 30 | -- Size : Natural) is 31 | -- begin 32 | -- null; 33 | -- end SS_Init; 34 | 35 | procedure SS_Allocate 36 | (Addr : out System.Address; 37 | Storage_Size : System.Storage_Elements.Storage_Count) is 38 | use type System.Parameters.Size_Type; 39 | 40 | Current_Stack : constant Stack_Ptr := Get_Current_Stack; 41 | 42 | Aligned_Size : constant System.Parameters.Size_Type := 43 | ((System.Parameters.Size_Type (Storage_Size) 44 | + Standard'Maximum_Alignment - 1) 45 | / Standard'Maximum_Alignment) 46 | * Standard'Maximum_Alignment; 47 | begin 48 | if Current_Stack.Top + Aligned_Size > Current_Stack.Size + 1 then 49 | raise Storage_Error; 50 | end if; 51 | 52 | Addr := Current_Stack.Mem (Current_Stack.Top)'Address; 53 | Current_Stack.Top := Current_Stack.Top + Aligned_Size; 54 | end SS_Allocate; 55 | 56 | function SS_Mark return Mark_Id is 57 | begin 58 | return Mark_Id (Get_Current_Stack.Top); 59 | end SS_Mark; 60 | 61 | procedure SS_Release (M : Mark_Id) is 62 | begin 63 | Get_Current_Stack.Top := System.Parameters.Size_Type (M); 64 | end SS_Release; 65 | 66 | end System.Secondary_Stack; 67 | -------------------------------------------------------------------------------- /common/gnat-ce-2020/s-secsta.adb: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2016-2017 Free Software Foundation, Inc. 2 | -- 3 | -- This file is part of the FreeRTOS-Ada project. This file is 4 | -- free software; you can redistribute it and/or modify it under 5 | -- terms of the GNU General Public License as published by the Free 6 | -- Software Foundation; either version 3, or (at your option) any 7 | -- later version. This file is distributed in the hope that it will 8 | -- be useful, but WITHOUT ANY WARRANTY; without even the implied 9 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | -- 11 | -- As a special exception under Section 7 of GPL version 3, you are 12 | -- granted additional permissions described in the GCC Runtime 13 | -- Library Exception, version 3.1, as published by the Free Software 14 | -- Foundation. 15 | -- 16 | -- You should have received a copy of the GNU General Public License 17 | -- and a copy of the GCC Runtime Library Exception along with this 18 | -- program; see the files COPYING3 and COPYING.RUNTIME respectively. 19 | -- If not, see . 20 | 21 | with System.Tasking; 22 | 23 | package body System.Secondary_Stack is 24 | 25 | function Get_Current_Stack return SS_Stack_Ptr is 26 | (System.Tasking.Self.Secondary_Stack); 27 | 28 | -- procedure SS_Init 29 | -- (Stk : in out Address; 30 | -- Size : Natural) is 31 | -- begin 32 | -- null; 33 | -- end SS_Init; 34 | 35 | procedure SS_Allocate 36 | (Addr : out System.Address; 37 | Storage_Size : System.Storage_Elements.Storage_Count) is 38 | use type System.Parameters.Size_Type; 39 | 40 | Current_Stack : constant SS_Stack_Ptr := Get_Current_Stack; 41 | 42 | Aligned_Size : constant System.Parameters.Size_Type := 43 | ((System.Parameters.Size_Type (Storage_Size) 44 | + Standard'Maximum_Alignment - 1) 45 | / Standard'Maximum_Alignment) 46 | * Standard'Maximum_Alignment; 47 | begin 48 | if Current_Stack.Top + Aligned_Size > Current_Stack.Size + 1 then 49 | raise Storage_Error; 50 | end if; 51 | 52 | Addr := Current_Stack.Mem (Current_Stack.Top)'Address; 53 | Current_Stack.Top := Current_Stack.Top + Aligned_Size; 54 | end SS_Allocate; 55 | 56 | function SS_Mark return Mark_Id is 57 | begin 58 | return Mark_Id (Get_Current_Stack.Top); 59 | end SS_Mark; 60 | 61 | procedure SS_Release (M : Mark_Id) is 62 | begin 63 | Get_Current_Stack.Top := System.Parameters.Size_Type (M); 64 | end SS_Release; 65 | 66 | end System.Secondary_Stack; 67 | -------------------------------------------------------------------------------- /common/gnat.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- G N A T -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- Copyright (C) 1992-2005 AdaCore -- 10 | -- -- 11 | -- GNAT is free software; you can redistribute it and/or modify it under -- 12 | -- terms of the GNU General Public License as published by the Free Soft- -- 13 | -- ware Foundation; either version 3, or (at your option) any later ver- -- 14 | -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 15 | -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- 16 | -- or FITNESS FOR A PARTICULAR PURPOSE. -- 17 | -- -- 18 | -- As a special exception under Section 7 of GPL version 3, you are granted -- 19 | -- additional permissions described in the GCC Runtime Library Exception, -- 20 | -- version 3.1, as published by the Free Software Foundation. -- 21 | -- -- 22 | -- You should have received a copy of the GNU General Public License and -- 23 | -- a copy of the GCC Runtime Library Exception along with this program; -- 24 | -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- 25 | -- . -- 26 | -- -- 27 | -- GNAT was originally developed by the GNAT team at New York University. -- 28 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- 29 | -- -- 30 | ------------------------------------------------------------------------------ 31 | 32 | -- This is the parent package for a library of useful units provided with GNAT 33 | 34 | package GNAT is 35 | pragma Pure; 36 | 37 | end GNAT; 38 | --------------------------------------------------------------------------------