1
0
mirror of https://github.com/preble/libpinproc synced 2026-02-24 18:25:23 +01:00

Moved libftdi-specific code to PRHardware.cpp and added abstract PRHardware*() functions.

Added PRCommon.h.
This commit is contained in:
Adam Preble
2009-05-26 20:18:36 -04:00
parent 179125367b
commit 511d5d49c4
6 changed files with 184 additions and 110 deletions

View File

@@ -29,9 +29,9 @@
*/
#include "../include/pinproc.h"
#include "PRCommon.h"
#include "PRHardware.h"
#include <queue>
#include <ftdi.h>
using namespace std;
@@ -39,13 +39,6 @@ using namespace std;
#define maxDrivers (256)
#define maxSwitchRules (256<<2) // 8 bits of switchNum indicies plus bits for debounced and state.
#ifdef NDEBUG
# define DEBUG(block)
#else
# define DEBUG(block) block
#endif
extern void PRLog(const char *format, ...);
class PRDevice
{
public:
@@ -117,9 +110,6 @@ protected:
queue<uint32_t> unrequestedDataQueue; /**< Queue of words received from the device that were not requested via RequestData(). Usually switch events. */
queue<uint32_t> requestedDataQueue; /**< Queue of words received from the device as the result of a call to RequestData(). */
bool ftdiInitialized;
ftdi_context ftdic;
uint8_t collected_bytes_fifo[FTDI_BUFFER_SIZE];
int32_t collected_bytes_rd_addr;
int32_t collected_bytes_wr_addr;