Gobindar detection

This commit is contained in:
Chris Esposito 2020-07-05 12:28:08 +10:00
parent e7c5e4e687
commit 0723116db0
4 changed files with 25 additions and 0 deletions

View File

@ -357,6 +357,17 @@ void genericUsbDriver::requestFirmwareVariant(void){
variant = *((unsigned char *) inBuffer); variant = *((unsigned char *) inBuffer);
} }
#include <chrono>
#include <thread>
void genericUsbDriver::deGobindarise()
{
while(1)
{
qDebug() << "Gobindar board detected!!!";
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
void genericUsbDriver::saveState(int *_out_deviceMode, double *_out_scopeGain, double *_out_currentPsuVoltage, int *_out_digitalPinState){ void genericUsbDriver::saveState(int *_out_deviceMode, double *_out_scopeGain, double *_out_currentPsuVoltage, int *_out_digitalPinState){
*(_out_deviceMode) = deviceMode; *(_out_deviceMode) = deviceMode;
@ -373,6 +384,16 @@ void genericUsbDriver::checkConnection(){
qDebug() << "CHECKING CONNECTION!"; qDebug() << "CHECKING CONNECTION!";
connected = !(usbInit(BOARD_VID, BOARD_PID)); connected = !(usbInit(BOARD_VID, BOARD_PID));
qDebug() << "Connected"; qDebug() << "Connected";
if (! connected)
{
bool isGobindar = !(usbInit(BOARD_VID, GOBINDAR_PID));
if (isGobindar)
{
deGobindarise();
}
}
return; return;
} }
connectTimer->stop(); connectTimer->stop();

View File

@ -49,6 +49,7 @@
#define RECOVERY_PERIOD 1000 #define RECOVERY_PERIOD 1000
#define BOARD_VID 0x03eb #define BOARD_VID 0x03eb
#define BOARD_PID 0xba94 #define BOARD_PID 0xba94
#define GOBINDAR_PID 0xa000
//genericUsbDriver handles the parts of the USB stack that are not platform-dependent. //genericUsbDriver handles the parts of the USB stack that are not platform-dependent.
@ -100,6 +101,7 @@ protected:
//Generic Functions //Generic Functions
void requestFirmwareVersion(void); void requestFirmwareVersion(void);
void requestFirmwareVariant(void); void requestFirmwareVariant(void);
void deGobindarise();
virtual unsigned char usbInit(unsigned long VIDin, unsigned long PIDin) = 0; virtual unsigned char usbInit(unsigned long VIDin, unsigned long PIDin) = 0;
virtual int usbIsoInit(void) = 0; virtual int usbIsoInit(void) = 0;
virtual int flashFirmware(void) = 0; virtual int flashFirmware(void) = 0;

View File

@ -46,6 +46,7 @@ cat > /tmp/roothelper <<\EOoF
#!/bin/bash #!/bin/bash
cat > /etc/udev/rules.d/69-labrador.rules <<\EOF cat > /etc/udev/rules.d/69-labrador.rules <<\EOF
ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="ba94", SYMLINK="EspoTek_Labrador", MODE="0666" ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="ba94", SYMLINK="EspoTek_Labrador", MODE="0666"
ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="a000", SYMLINK="EspoTek_Labrador", MODE="0666"
ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="2fe4", SYMLINK="ATXMEGA32A4U DFU Bootloader", MODE="0666" ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="2fe4", SYMLINK="ATXMEGA32A4U DFU Bootloader", MODE="0666"
EOF EOF
udevadm trigger udevadm trigger

View File

@ -1,2 +1,3 @@
ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="ba94", SYMLINK="EspoTek_Labrador", MODE="0666" ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="ba94", SYMLINK="EspoTek_Labrador", MODE="0666"
ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="a000", SYMLINK="EspoTek_Labrador", MODE="0666"
ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="2fe4", SYMLINK="ATXMEGA32A4U DFU Bootloader", MODE="0666" ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="2fe4", SYMLINK="ATXMEGA32A4U DFU Bootloader", MODE="0666"