-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit version has been tested to work. Changes: * Added PC hidapi based console software to issue commands to device. * Hidapi moved to software/lib. * Added argp-standalone submodule. * Changed USB Device Name & Vendor Name. Added name to dlusb_packet struct. * Firmware version in USB release descriptor upped to 1.02. * Added auto software version take from git. * Added small README file to extra dir.
- Loading branch information
Showing
16 changed files
with
415 additions
and
13 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This dir contains related software projects. Currently unused, just for the reference. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,5 +213,3 @@ extern "C" { | |
#endif | ||
|
||
DLUSBDevice DLUSB = DLUSBDevice(&rx_buffer, &tx_buffer); | ||
|
||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
build | ||
build.old | ||
|
||
.vscode/.browse.c_cpp.db* | ||
.vscode/c_cpp_properties.json | ||
.vscode/launch.json | ||
.vscode/ipch |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-vscode.cmake-tools" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"cmake.generator": "Ninja", | ||
"cmake.configureArgs": [ | ||
"-Wno-dev" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
set(PROJECT_NAME "digilivolo") | ||
project(${PROJECT_NAME} C) | ||
|
||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -std=gnu11 -flto -ffunction-sections -fdata-sections -Wall -Wl,--warn-common -Wl,--gc-sections -Wl,-lm") | ||
set(HIDAPI_WITH_LIBUSB FALSE) | ||
set(BUILD_SHARED_LIBS FALSE) # HIDAPI as static library on all platforms | ||
|
||
if(POLICY CMP0074) | ||
# allow using hidapi_ROOT if CMake supports it | ||
cmake_policy(SET CMP0074 NEW) | ||
endif() | ||
|
||
if(POLICY CMP0115) | ||
cmake_policy(SET CMP0115 NEW) | ||
endif() | ||
|
||
# Get version from git | ||
execute_process( | ||
COMMAND git describe --tags | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} | ||
OUTPUT_VARIABLE GIT_VERSION | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
message(STATUS "Project: ${PROJECT_NAME} ${GIT_VERSION}") | ||
|
||
if(NOT USE_SYSTEM_HIDAPI) | ||
add_subdirectory(lib/hidapi) | ||
message(STATUS "hidapi will be built from sources") | ||
else() | ||
message(STATUS "Finding library hidapi") | ||
find_package(hidapi 0.12 REQUIRED) | ||
endif() | ||
|
||
message(STATUS "Using HIDAPI: ${hidapi_VERSION}") | ||
|
||
add_subdirectory(lib/argp-standalone) | ||
|
||
configure_file(src/git_version.h.in src/git_version.h @ONLY) | ||
add_executable(${PROJECT_NAME} src/digilivolo.c) | ||
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/src") | ||
target_link_libraries(${PROJECT_NAME} hidapi::hidapi argp-standalone) | ||
|
||
# Strip binary for release builds | ||
add_custom_command( | ||
TARGET ${PROJECT_NAME} POST_BUILD | ||
COMMAND ${CMAKE_STRIP} $<TARGET_FILE:${PROJECT_NAME}> | ||
VERBATIM | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Builds project with cmake. | ||
# If called with any argument, does a full rebuild by moving a build dir to | ||
# build.old (deleting build.old if exits). | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
echo "Working dir: ${SCRIPT_DIR}" | ||
|
||
if [[ ! -z "$1" ]]; then | ||
rm -rf ${SCRIPT_DIR}/build.old | ||
mv ${SCRIPT_DIR}/build ${SCRIPT_DIR}/build.old | ||
fi | ||
|
||
mkdir ${SCRIPT_DIR}/build 2>/dev/null | ||
pushd . | ||
cd ${SCRIPT_DIR}/build | ||
|
||
# cmake -DUSE_SYSTEM_HIDAPI=false -G 'Unix Makefiles' .. | ||
cmake -DUSE_SYSTEM_HIDAPI=false -G 'Ninja' -Wno-dev .. | ||
cmake --build . | ||
|
||
popd |
Submodule argp-standalone
added at
1684ac
Submodule hidapi
updated
from 000000 to d3013f
Oops, something went wrong.