Skip to content

Commit

Permalink
Create alias "GUI.Screen_Buffer" to "STM32.Board.Display.Hidden_Buffe…
Browse files Browse the repository at this point in the history
…r (1)"
  • Loading branch information
masonticehurst committed Feb 9, 2024
1 parent 90aeca2 commit 1fdb242
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions eRINA_STM32F7/src/rina/debug.adb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ package body Debug is

-- Draw debug prefix
Bitmapped_Drawing.Draw_String
(Buffer => STM32.Board.Display.Hidden_Buffer (1).all,
(Buffer => GUI.Screen_Buffer.all,
Start =>
GUI.Scale
((CURRENT_CONSOLE_POSITION.X, CURRENT_CONSOLE_POSITION.Y)),
Expand All @@ -42,7 +42,7 @@ package body Debug is

-- Draw actual message text
Bitmapped_Drawing.Draw_String
(Buffer => STM32.Board.Display.Hidden_Buffer (1).all,
(Buffer => GUI.Screen_Buffer.all,
Start =>
GUI.Scale
((CURRENT_CONSOLE_POSITION.X +
Expand Down Expand Up @@ -73,14 +73,14 @@ package body Debug is
Height => FONT_HEIGHT);
begin
HAL.Bitmap.Copy_Rect
(Src_Buffer => STM32.Board.Display.Hidden_Buffer (1).all,
(Src_Buffer => GUI.Screen_Buffer.all,
Src_Pt => srcToPoint,
Dst_Buffer => STM32.Board.Display.Hidden_Buffer (1).all,
Dst_Buffer => GUI.Screen_Buffer.all,
Dst_Pt => dstToPoint, Width => GUI.Board_Resolution.Width,
Height => FONT_HEIGHT, Synchronous => True);
if DeleteSrc then
HAL.Bitmap.Fill_Rect
(Buffer => STM32.Board.Display.Hidden_Buffer (1).all,
(Buffer => GUI.Screen_Buffer.all,
Area => srcRect);
end if;
STM32.Board.Display.Update_Layer (1, True);
Expand Down
2 changes: 1 addition & 1 deletion eRINA_STM32F7/src/rina/gui.adb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package body GUI is
procedure Print (Msg : in String; Pos : in HAL.Bitmap.Point) is
begin
Bitmapped_Drawing.Draw_String
(Buffer => STM32.Board.Display.Hidden_Buffer (1).all,
(Buffer => GUI.Screen_Buffer.all,
Start => Scale ((Pos.X, Pos.Y)),
Msg => Msg,
Font => BMP_Fonts.Font8x8,
Expand Down
3 changes: 3 additions & 0 deletions eRINA_STM32F7/src/rina/gui.ads
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
with BMP_Fonts;
with HAL.Bitmap;
with STM32.Board;

package GUI is
pragma Warnings (Off);
Expand All @@ -15,6 +16,8 @@ package GUI is

Board_Resolution : Size := (480, 272);

Screen_Buffer : HAL.Bitmap.Any_Bitmap_Buffer renames STM32.Board.Display.Hidden_Buffer (1);

procedure Initialize (Title : in String);
procedure Print (Msg : in String; Pos : in HAL.Bitmap.Point);

Expand Down
4 changes: 2 additions & 2 deletions eRINA_STM32F7/src/rina/textures.adb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ package body Textures is
begin
for Row in 0 .. Textures.Texture_Height - 1 loop
for Column in 0 .. Textures.Texture_Width - 1 loop
STM32.Board.Display.Hidden_Buffer (1).Set_Source
GUI.Screen_Buffer.Set_Source
(Bitmap_Color_Conversion.Word_To_Bitmap_Color
(HAL.Bitmap.ARGB_1555, HAL.UInt32 (T (Row) (Column))));
STM32.Board.Display.Hidden_Buffer (1).Set_Pixel
GUI.Screen_Buffer.Set_Pixel
((Pos.X + Row, Pos.Y + Column));
end loop;
end loop;
Expand Down

0 comments on commit 1fdb242

Please sign in to comment.