mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
Initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
cmake_minimum_required ( VERSION 2.8 )
|
||||
|
||||
project ( example C )
|
||||
|
||||
find_package ( LibFTDI1 NO_MODULE REQUIRED )
|
||||
include ( ${LIBFTDI_USE_FILE} )
|
||||
|
||||
add_executable ( example main.c )
|
||||
target_link_libraries( example ${LIBFTDI_LIBRARIES} )
|
||||
|
||||
install ( TARGETS example
|
||||
DESTINATION bin )
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/* main.c
|
||||
|
||||
Example for ftdi_new()
|
||||
|
||||
This program is distributed under the GPL, version 2
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ftdi.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
struct ftdi_context *ftdi;
|
||||
int retval = EXIT_SUCCESS;
|
||||
|
||||
if ((ftdi = ftdi_new()) == 0)
|
||||
{
|
||||
fprintf(stderr, "ftdi_new failed\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
Reference in New Issue
Block a user