Skip to content

Commit

Permalink
Use symbolic interrupt priority for SDMMC. (#382)
Browse files Browse the repository at this point in the history
* Use symbolic interrupt priority for SDMMC.

  * arch/ARM/STM32/drivers/sd/stm32-sdmmc_interrupt.ads
    (SDMMC_Interrupt_Handler): Supply the required interrupt priority via
      a discriminant.

* Added omitted 'with System'.

  * arch/ARM/STM32/drivers/sd/stm32-sdmmc_interrupt.ads: as summary.

* Matching change for boards where SDCard is used.

 * boards/stm32_common/sdcard/sdcard.adb (SD_Interrupt_Handler):
     include Priority discriminant.
  • Loading branch information
simonjwright authored Mar 11, 2021
1 parent 663a729 commit f100ce7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions arch/ARM/STM32/drivers/sd/stm32-sdmmc_interrupt.ads
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2016-2017, AdaCore --
-- Copyright (C) 2016-2021, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
Expand Down Expand Up @@ -34,6 +34,7 @@

with HAL.SDMMC; use HAL.SDMMC;
with Ada.Interrupts;
with System;

limited with STM32.SDMMC;

Expand All @@ -44,9 +45,10 @@ package STM32.SDMMC_Interrupt is
------------------

protected type SDMMC_Interrupt_Handler
(Interrupt_ID : Ada.Interrupts.Interrupt_ID)
(Interrupt_ID : Ada.Interrupts.Interrupt_ID;
Priority : System.Interrupt_Priority)
is
pragma Interrupt_Priority (250);
pragma Interrupt_Priority (Priority);

procedure Set_Transfer_State (This : in out STM32.SDMMC.SDMMC_Controller);
procedure Clear_Transfer_State;
Expand Down
8 changes: 6 additions & 2 deletions boards/stm32_common/sdcard/sdcard.adb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2016, AdaCore --
-- Copyright (C) 2015-2021, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
Expand Down Expand Up @@ -39,9 +39,13 @@ with STM32.GPIO; use STM32.GPIO;
with STM32.SDMMC; use STM32.SDMMC;
with STM32.SDMMC_Interrupt; use STM32.SDMMC_Interrupt;

with System;

package body SDCard is

SD_Interrupt_Handler : aliased SDMMC_Interrupt_Handler (SD_Interrupt);
SD_Interrupt_Handler : aliased SDMMC_Interrupt_Handler
(Interrupt_ID => SD_Interrupt,
Priority => System.Interrupt_Priority'Last);

----------------
-- Initialize --
Expand Down

0 comments on commit f100ce7

Please sign in to comment.