mirror of https://github.com/EspoTek/Labrador.git
Gobindar detection
This commit is contained in:
parent
e7c5e4e687
commit
0723116db0
|
@ -357,6 +357,17 @@ void genericUsbDriver::requestFirmwareVariant(void){
|
|||
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){
|
||||
*(_out_deviceMode) = deviceMode;
|
||||
|
@ -373,6 +384,16 @@ void genericUsbDriver::checkConnection(){
|
|||
qDebug() << "CHECKING CONNECTION!";
|
||||
connected = !(usbInit(BOARD_VID, BOARD_PID));
|
||||
qDebug() << "Connected";
|
||||
|
||||
if (! connected)
|
||||
{
|
||||
bool isGobindar = !(usbInit(BOARD_VID, GOBINDAR_PID));
|
||||
if (isGobindar)
|
||||
{
|
||||
deGobindarise();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
connectTimer->stop();
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#define RECOVERY_PERIOD 1000
|
||||
#define BOARD_VID 0x03eb
|
||||
#define BOARD_PID 0xba94
|
||||
#define GOBINDAR_PID 0xa000
|
||||
|
||||
|
||||
//genericUsbDriver handles the parts of the USB stack that are not platform-dependent.
|
||||
|
@ -100,6 +101,7 @@ protected:
|
|||
//Generic Functions
|
||||
void requestFirmwareVersion(void);
|
||||
void requestFirmwareVariant(void);
|
||||
void deGobindarise();
|
||||
virtual unsigned char usbInit(unsigned long VIDin, unsigned long PIDin) = 0;
|
||||
virtual int usbIsoInit(void) = 0;
|
||||
virtual int flashFirmware(void) = 0;
|
||||
|
|
|
@ -46,6 +46,7 @@ cat > /tmp/roothelper <<\EOoF
|
|||
#!/bin/bash
|
||||
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}=="a000", SYMLINK="EspoTek_Labrador", MODE="0666"
|
||||
ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="2fe4", SYMLINK="ATXMEGA32A4U DFU Bootloader", MODE="0666"
|
||||
EOF
|
||||
udevadm trigger
|
||||
|
|
|
@ -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}=="a000", SYMLINK="EspoTek_Labrador", MODE="0666"
|
||||
ENV{ID_VENDOR_ID}=="03eb", ENV{ID_MODEL_ID}=="2fe4", SYMLINK="ATXMEGA32A4U DFU Bootloader", MODE="0666"
|
||||
|
|
Loading…
Reference in New Issue