text stringlengths 0 234 |
|---|
Tmp : UInt16_HL_Type; |
Status : Boolean; |
begin |
-- X/Y are swaped from the screen coordinates |
if Touch_Id not in FT5336_Px_Regs'Range |
or else Touch_Id > This.Active_Touch_Points |
then |
return (0, 0, 0); |
end if; |
Regs := FT5336_Px_Regs (Touch_Id); |
Tmp.Low := This.I2C_Read (Regs.XL_Reg, Status); |
if not Status then |
return (0, 0, 0); |
end if; |
Tmp.High := This.I2C_Read (Regs.XH_Reg, Status) and |
FT5336_TOUCH_POS_MSB_MASK; |
if not Status then |
return (0, 0, 0); |
end if; |
Ret.Y := Natural (To_UInt16 (Tmp)); |
Tmp.Low := This.I2C_Read (Regs.YL_Reg, Status); |
if not Status then |
return (0, 0, 0); |
end if; |
Tmp.High := This.I2C_Read (Regs.YH_Reg, Status) and |
FT5336_TOUCH_POS_MSB_MASK; |
if not Status then |
return (0, 0, 0); |
end if; |
Ret.X := Natural (To_UInt16 (Tmp)); |
Ret.Weight := Natural (This.I2C_Read (Regs.Weight_Reg, Status)); |
if not Status then |
Ret.Weight := 0; |
end if; |
Ret.X := |
Natural'Min (Natural'Max (0, Ret.X), This.LCD_Natural_Width - 1); |
Ret.Y := |
Natural'Min (Natural'Max (0, Ret.Y), This.LCD_Natural_Height - 1); |
if (This.Swap and Invert_X) /= 0 then |
Ret.X := This.LCD_Natural_Width - Ret.X - 1; |
end if; |
if (This.Swap and Invert_Y) /= 0 then |
Ret.Y := This.LCD_Natural_Height - Ret.Y - 1; |
end if; |
if (This.Swap and Swap_XY) /= 0 then |
declare |
Tmp_X : constant Integer := Ret.X; |
begin |
Ret.X := Ret.Y; |
Ret.Y := Tmp_X; |
Function Definition: procedure Destroy is new Ada.Unchecked_Deallocation |
Function Body: (File_Handle, File_Handle_Access); |
procedure Destroy is new Ada.Unchecked_Deallocation |
(Directory_Handle, Directory_Handle_Access); |
procedure Destroy is new Ada.Unchecked_Deallocation |
(Node_Handle, Node_Handle_Access); |
function "<" (Left, Right : Node_Handle) return Boolean is |
(Ada.Strings.Unbounded."<" (Left.Name, Right.Name)); |
package Node_Sorting is |
new Node_Vectors.Generic_Sorting; |
-- Most of the time, standard operations give us no reliable way to |
-- determine specifically what triggered a failure, so use the following |
-- error code as a "generic" one. |
Generic_Error : constant Status_Code := Input_Output_Error; |
function Absolute_Path |
(This : Native_FS_Driver; |
Relative_Path : String) |
return String |
is (if Relative_Path = "" |
then +This.Root_Dir |
else Join (+This.Root_Dir, Relative_Path, True)); |
---------------- |
-- Get_Handle -- |
---------------- |
function Get_Handle |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.