Commit 3793c4be authored by Gallacchi Mattia's avatar Gallacchi Mattia
Browse files

Add HID interface for linux

parent d6c4247c
Loading
Loading
Loading
Loading

.vscode/launch.json

0 → 100644
+56 −0
Original line number Diff line number Diff line
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C++ Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/tests/i2c_scan",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        },
        {
            "name": "HID Test Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/debug/tests/hid_test",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}/build/debug/tests",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true

                }
            ],
            "preLaunchTask": "build tests",
            "miDebuggerPath": "/usr/bin/gdb"
        }


    ]
}
 No newline at end of file

.vscode/tasks.json

0 → 100644
+32 −0
Original line number Diff line number Diff line
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "configure debug",
            "type": "shell",
            "command": "cmake",
            "args": [
                "--preset",
                "linux-debug",
            ]
        },
        {
            "label": "build tests",
            "type": "cppbuild",
            "command": "cmake",
            "args": [
                "--build",
                "build/debug"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ],
            "dependsOn": "configure debug",
            "dependsOrder": "sequence"
        }
    ]
}
 No newline at end of file
+8 −1
Original line number Diff line number Diff line
@@ -47,12 +47,19 @@ if (UNIX)
    add_library(i2c STATIC IMPORTED)
    set_target_properties(i2c PROPERTIES IMPORTED_LOCATION ${I2C_LIB_PATH})
    include_directories(${I2C_INCLUDE_DIR})

    find_package(PkgConfig REQUIRED)
    pkg_check_modules(LIBUSB REQUIRED libusb-1.0)

elseif(WIN32)
    include_directories(${CMAKE_CURRENT_SOURCE_DIR}/MCP2221_DLL/unmanaged/dll)
    set(MCP_DLL "${CMAKE_CURRENT_SOURCE_DIR}/MCP2221_DLL/unmanaged/dll/mcp2221_dll_um_x64.dll" CACHE INTERNAL "Path to MCP2221 DLL")
endif()

include_directories(lib)
include_directories(
    lib
    ${LIBUSB_INCLUDE_DIRS}
)
add_subdirectory(lib)

if (BUILD_TESTS)
+14 −3
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
            "binaryDir": "${sourceDir}/build",
            "cacheVariables": {
                "CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
                "CMAKE_BUILD_TYPE": "Release",
                "CMAKE_CXX_STANDARD": "20"
            }
        },
@@ -20,11 +19,23 @@
                "value": "x64"
            }
        },
        {
            "name": "linux-debug",
            "binaryDir": "${sourceDir}/build/debug",
            "generator": "Unix Makefiles",
            "inherits": ["default"],
            "cacheVariables": {
                "CMAKE_BUILD_TYPE": "Debug"
            }
        },
        {
            "name": "linux",
            "binaryDir": "${sourceDir}/build",
            "binaryDir": "${sourceDir}/build/release",
            "generator": "Unix Makefiles",
            "inherits": ["default"]
            "inherits": ["default"],
            "cacheVariables": {
                "CMAKE_BUILD_TYPE": "Release"
            }
        }
    ]
  }
 No newline at end of file

interface.txt

0 → 100644
+0 −0

Empty file added.

Loading