Commit d8570479 authored by David Košenina's avatar David Košenina

eeprom, callibration

parent 42132552
......@@ -23,8 +23,8 @@
"framesPerCapture": 2,
"maxIterations": 128,
"exitPercentage": 0.0244140625,
"offsetMax": 1500,
"offsetMin": -1500,
"offsetMax": 400,
"offsetMin": -400,
"generatorReference": 0,
"generatorMax": 95,
"generatorMin": -95,
......
......@@ -271,20 +271,21 @@ int usbFx3WriteEEPROM(UsbContext* ctx, unsigned char* buffer, int size, int writ
if(usbFxxIsConnected(ctx))
{
// write eeprom
int chunk = 2048;
int chunk = 1024;
int loop = size / chunk;
int left = size % chunk;
int ret = 0;
for(int i = 0; i < loop; i++)
{
int ret = writeDataEeprom(ctx,
ret += writeDataEeprom(ctx,
writeadress + (chunk * i),
buffer + (chunk * i),
chunk);
}
int ret = writeDataEeprom(ctx,
writeadress + (chunk * loop),
buffer + (chunk * loop),
left);
ret += writeDataEeprom(ctx,
writeadress + (chunk * loop),
buffer + (chunk * loop),
left);
if(ret == 0)
{
return PUREUSB_SUCCESS;
......
......@@ -37,11 +37,12 @@ void OsciloskopDebug::ThermalOnActivate(wxActivateEvent& event)
}
void OsciloskopDebug::Clear()
{
#ifdef PLATFORM_MINGW
system("cls");
#if defined(PLATFORM_MINGW)
system("cls");
#else
system("clear");
system("clear");
#endif
m_textCtrl41->Clear();
}
void OsciloskopDebug::AppendText(const char* str)
{
......
......@@ -425,11 +425,6 @@ void OsciloskopOsciloskop::OnIdle(wxIdleEvent& event)
// reset gui
if(pOsciloscope->callibrate.resetUI)
{
// slot
wxFileName fn = GetOscDataFolder();
wxString fileName = fn.GetPath().append(_("/data/callibrate/start.slot"));
LoadSlot(getCurrentSlot(), fileName.ToAscii().data());
loadWindow(getCurrentSlot());
// callibrate
pOsciloscope->settings.getHardware()->save();
pOsciloscope->setupControl(pOsciloscope->window);
......@@ -2219,7 +2214,6 @@ void OsciloskopOsciloskop::m_menuItemReadEEPROMOnMenuSelection(wxCommandEvent& e
pDebug->Clear();
FORMAT_BUFFER();
int count = min(16,size / EEPROM_BYTE_COUNT);
int left = size % EEPROM_BYTE_COUNT;
for(int i=0;i<count;i++)
{
for(int j = 0; j < EEPROM_BYTE_COUNT; j++)
......@@ -2230,12 +2224,6 @@ void OsciloskopOsciloskop::m_menuItemReadEEPROMOnMenuSelection(wxCommandEvent& e
}
pDebug->AppendText(wxString::FromAscii("\n"));
}
for (int j = 0; j < left; j++)
{
byte byteToPrint = eeprom.data.bytes[count*EEPROM_BYTE_COUNT + j];
FORMAT("%02x ", byteToPrint);
pDebug->AppendText(wxString::FromAscii(formatBuffer));
}
}
}
......
This diff is collapsed.
......@@ -812,6 +812,7 @@ enum EThreadApiFunction {
afSetNetwork,
afClientConnect,
afClientDisconnect,
afLast,
};
class ThreadApi {
......@@ -819,7 +820,7 @@ private:
SDL_SpinLock lock;
SDL_atomic_t sync;
Array<EThreadApiFunction,16> func;
SDL_atomic_t ret;
SDL_atomic_t ret[afLast];
private:
SDL_atomic_t open;
SDL_atomic_t connected;
......@@ -863,6 +864,10 @@ public:
void function(EThreadApiFunction func);
void wait();
void update();
public:
int result(EThreadApiFunction func);
void resultClear(EThreadApiFunction func);
void resultClearAll();
public:
// data
int getVersion();
......@@ -891,6 +896,7 @@ public:
void setIpPort(const char* ip, uint port);
public:
// controlThread
int openUSB(OscHardware* hw);
int writeFpgaToArtix7(SHardware1* ctrl1, SHardware2* ctrl2, OscHardware* hw);
int writeUsbToEEPROM(OscHardware* hw);
int readUsbFromEEPROM(OscHardware* hw);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment