From 5f0d290de700ddffa6750e95344fdc9fb49301db Mon Sep 17 00:00:00 2001 From: Christian Gromm Date: Thu, 28 Jul 2016 14:15:55 +0200 Subject: src: can-lin: Usb-Driver: prepare directory for yocto build This patch cleans the Usb-Driver directory. It removes files not needed for the build process and fixes the Makefile. The patch is needed for bitbake to fetch the source and compile the kernel module. Change-Id: I7748629d5c5b9a2cfcc3c6db63e64a10270fd77d Signed-off-by: Christian Gromm --- Usb-Driver/test-mocca.c | 68 ------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 Usb-Driver/test-mocca.c (limited to 'Usb-Driver/test-mocca.c') diff --git a/Usb-Driver/test-mocca.c b/Usb-Driver/test-mocca.c deleted file mode 100644 index 70c4760..0000000 --- a/Usb-Driver/test-mocca.c +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -uint8_t relayOn[] = { - 0x04, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x13, - 0x02, 0x0b, 0x70, 0x07, 0x00, 0x00, 0x01, 0x00 -}; - -uint8_t relayOff[] = { - 0x04, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x13, - 0x02, 0x0b, 0x70, 0x07, 0x00, 0x00, 0x00, 0x00 -}; - -uint8_t readBuffer[1024]; - -static int32_t repeat = 10; -static pthread_t readingThread; -static bool allowRun = true; -static int fd = -1; - -void* executeReading ( void* arg ) -{ - uint32_t bytesRead; - uint32_t i; - - while ( allowRun ) { - bytesRead = read ( fd, readBuffer, sizeof ( readBuffer ) ); - if ( bytesRead > 0 ) { - printf ( "Received bytes (hex): " ); - for ( i = 0; i < bytesRead; i++ ) { - printf ( "%02X ", readBuffer[i] ); - } - printf ( "\n" ); - } - } - pthread_exit ( 0 ); -} - -int main ( int argc, char* argv[] ) -{ - int ret; - if ( ( fd = open ( "/dev/mocca0", O_RDWR|O_SYNC ) ) < 0 ) { - printf ( "Failed to open mocca0 device\n" ); - exit ( -4 ); - } - ret = pthread_create ( &readingThread, NULL, executeReading, NULL ); - if ( ret ) { - printf ( "Failed to start reader thread\n" ); - } else { - while ( --repeat >= 0 ) { - write ( fd, relayOn, sizeof ( relayOn ) ); - usleep ( 1000000 ); - write ( fd, relayOff, sizeof ( relayOff ) ); - usleep ( 1000000 ); - } - } - allowRun = false; - - close ( fd ); - return 0; -} -- cgit 1.2.3-korg