text
stringlengths
0
234
loop
declare
Ent : constant Directory_Entry := Read (DD);
begin
exit when Ent = Invalid_Dir_Entry;
if not Ent.Hidden or else Show_All then
if First then
Put (Ent.Name);
First := False;
else
Put (" " & Ent.Name);
end if;
end if;
Function Definition: procedure Display_File (Path : String);
Function Body: ------------------
-- Display_File --
------------------
procedure Display_File (Path : String) is
FD : File_Descriptor;
Status : Status_Code;
Data : String (1 .. 512);
Amount : File_Size;
begin
Status := Open (FD, Path, Read_Only);
if Status /= OK then
Put_Line ("Cannot open file '" & Path & "': " & Status'Img);
return;
end if;
loop
Amount := Read (FD, Data'Address, Data'Length);
exit when Amount = 0;
Put (Data (Data'First .. Data'First + Natural (Amount) - 1));
end loop;
Close (FD);
end Display_File;
begin
loop
declare
Arg : constant String := Args.Next;
begin
if Arg'Length = 0 then
return;
end if;
Display_File (Arg);
Function Definition: procedure Reset_All_ADC_Units is
Function Body: begin
RCC_Periph.APB2RSTR.ADCRST := True;
RCC_Periph.APB2RSTR.ADCRST := False;
end Reset_All_ADC_Units;
------------------
-- Enable_Clock --
------------------
procedure Enable_Clock (This : aliased in out Digital_To_Analog_Converter)
is
pragma Unreferenced (This);
begin
RCC_Periph.APB1ENR.DACEN := True;
end Enable_Clock;
-----------
-- Reset --
-----------
procedure Reset (This : aliased in out Digital_To_Analog_Converter) is
pragma Unreferenced (This);
begin
RCC_Periph.APB1RSTR.DACRST := True;
RCC_Periph.APB1RSTR.DACRST := False;
end Reset;
------------------
-- Enable_Clock --
------------------
procedure Enable_Clock (This : aliased in out USART) is
begin
if This.Periph.all'Address = USART1_Base then
RCC_Periph.APB2ENR.USART1EN := True;
elsif This.Periph.all'Address = USART2_Base then
RCC_Periph.APB1ENR.USART2EN := True;
elsif This.Periph.all'Address = USART3_Base then
RCC_Periph.APB1ENR.USART3EN := True;
elsif This.Periph.all'Address = UART4_Base then
RCC_Periph.APB1ENR.UART4EN := True;
elsif This.Periph.all'Address = UART5_Base then
RCC_Periph.APB1ENR.UART5EN := True;
elsif This.Periph.all'Address = USART6_Base then
RCC_Periph.APB2ENR.USART6EN := True;
elsif This.Periph.all'Address = UART7_Base then
RCC_Periph.APB1ENR.UART7ENR := True;
elsif This.Periph.all'Address = UART8_Base then
RCC_Periph.APB1ENR.UART8ENR := True;