Skip to content

Commit

Permalink
linux tweaks to compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Stewart @beagleboard authored and Damian Stewart @beagleboard committed Jul 14, 2011
1 parent 238527e commit 339bfec
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/Gui.h
Expand Up @@ -11,6 +11,7 @@

#include <string>
#include <vector>
#include <algorithm>
using namespace std;

class GuiButton
Expand Down
22 changes: 17 additions & 5 deletions src/WatterottInput.cpp
Expand Up @@ -7,8 +7,18 @@
*
*/

#include "WatterottInput.h"
#include "ofMain.h"

#ifdef TARGET_LINUX

#include "WatterottInput.h"
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/spi/spidev.h>

static const uint8_t BITS_PER_WORD = 8;
Expand Down Expand Up @@ -81,9 +91,9 @@ int WatterottInput::setup( const char* device, uint8_t _mode, uint32_t _speed )
return false;
}

ofLog(OF_LOG_VERBOSE, "spi mode: %d", mode);
ofLog(OF_LOG_VERBOSE, "bits per word: %d", bits);
ofLog(OF_LOG_VERBOSE, "max speed: %d Hz (%d KHz)", speed, speed/1000);
ofLog(OF_LOG_VERBOSE, "WatterottInput: spi mode: %d", mode);
ofLog(OF_LOG_VERBOSE, "WatterottInput: bits per word: %d", bits);
ofLog(OF_LOG_VERBOSE, "WatterottInput: max speed: %d Hz (%d KHz)", speed, speed/1000);

return ret;
}
Expand Down Expand Up @@ -168,10 +178,12 @@ void WatterottInput::update()
x >>= 1; //x/2
y >>= 1; //y/2

printf(" got x %4i y %4i", x, y );
printf(" got x %4i y %4i \n", x, y );

}

}


#endif

6 changes: 6 additions & 0 deletions src/WatterottInput.h
Expand Up @@ -9,6 +9,10 @@

#pragma once

#ifdef TARGET_LINUX

#include <linux/types.h>

class WatterottInput
{
public:
Expand All @@ -35,3 +39,5 @@ class WatterottInput
uint8_t mode;

};

#endif
3 changes: 3 additions & 0 deletions src/WatterottScreen.cpp
Expand Up @@ -11,6 +11,8 @@
* Cross-compile with cross-gcc -I/path/to/cross-kernel/include
*/

#include "ofConstants.h"

#ifdef TARGET_LINUX

#include "WatterottScreen.h"
Expand Down Expand Up @@ -44,6 +46,7 @@ uint16_t WatterottScreen::rgb565( float r, float g, float b )

static uint8_t mode;
static uint8_t bits = 8;
static uint32_t delay = 0;

const static uint8_t LCD_DATA = 0x72;
const static uint8_t LCD_REGISTER = 0x70;
Expand Down
File renamed without changes.

0 comments on commit 339bfec

Please sign in to comment.