Created
October 6, 2022 15:16
-
-
Save microhobby/245022469ffbcea1a07a7579839d90a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Gambas module file | |
Library "libgpiod:2" | |
Library "libc:6" | |
Extern gpiod_version_string() As String In "libgpiod:2" | |
Extern gpiod_chip_open_by_number(chip As Integer) As Pointer In "libgpiod:2" | |
Extern __errno_location() As Pointer In "libc:6" | |
Public Sub Main() | |
Dim chip As Pointer | |
Dim ret As Integer | |
Dim errno As Pointer = __errno_location() | |
chip = gpiod_chip_open_by_number(0) | |
ret = Int@(errno) | |
Print "Errno :: " & ret | |
If IsNull(chip) Then | |
Quit ret | |
Endif | |
Quit 0 | |
End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment