Skip to content

Commit

Permalink
Merge pull request #405 from Matom-ai/litepcie-update-windows-fixups
Browse files Browse the repository at this point in the history
Fix minor Windows issues
  • Loading branch information
rjonaitis authored Feb 23, 2024
2 parents 4f38d26 + 9eaea63 commit 4c32bdc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
13 changes: 4 additions & 9 deletions src/comms/USB/FX3/FX3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,11 @@ void FX3::AbortEndpointXfers(uint8_t endPointAddr)
for (int i = 0; i < MAX_EP_CNT; i++)
{
std::scoped_lock lock{ FX3mutex };
USBTransferContext_FX3* FX3context = &static_cast<USBTransferContext_FX3*>(contexts)[i];

if (InEndPt[i] && InEndPt[i]->Address == endPointAddr)
{
InEndPt[i]->Abort();
}

if (OutEndPt[i] && OutEndPt[i]->Address == endPointAddr)
if (FX3context->used && FX3context->EndPt->Address == endPointAddr)
{
OutEndPt[i]->Abort();
FX3context->EndPt->Abort();
}
}

Expand All @@ -355,8 +351,7 @@ void FX3::WaitForXfers(uint8_t endPointAddr)
{
USBTransferContext_FX3* FX3context = &static_cast<USBTransferContext_FX3*>(contexts)[i];

if (FX3context->used &&
((OutEndPt[i] && OutEndPt[i]->Address == endPointAddr) || (InEndPt[i] && InEndPt[i]->Address == endPointAddr)))
if (FX3context->used && FX3context->EndPt->Address == endPointAddr)
{
WaitForXfer(i, 250);
FinishDataXfer(nullptr, 0, i);
Expand Down
2 changes: 0 additions & 2 deletions src/lms7suiteApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

#include <wx/app.h>

class ConnectionManager;

class lms7suiteApp : public wxApp
{
public:
Expand Down
5 changes: 5 additions & 0 deletions src/lms7suiteAppFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,11 @@ ISOCPanel* CreateGUI(wxWindow* parent, eDeviceNodeClass deviceNodeClass, void* s
void LMS7SuiteAppFrame::DeviceTreeSelectionChanged(wxTreeEvent& event)
{
DeviceTreeItemData* item = reinterpret_cast<DeviceTreeItemData*>(deviceTree->GetItemData(event.GetItem()));
if (item->gui != nullptr && mContent == item->gui)
{
return;
}

if (item->gui == nullptr)
item->gui = CreateGUI(m_scrolledWindow1, item->soc->deviceNodeClass, item->soc->ptr);

Expand Down
19 changes: 13 additions & 6 deletions src/oglGraph/OpenGLGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const int OpenGLGraph::GLCanvasAttributes[8] = {
WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, WX_GL_STENCIL_SIZE, 0, 0, 0
};

bool OpenGLGraph::hasNotRecentEnoughOpenGLVersionWarningBeenThrownYet = false;

static constexpr bool IsGlew1_5()
{
#ifdef __GNUC__
Expand Down Expand Up @@ -191,12 +193,17 @@ bool OpenGLGraph::Initialize(int width, int height)

if (!oglOk)
{
wxMessageBox(
wxString::Format(
"Your OpenGL version is %s, required version is 2.0\nPlease update your graphics card drivers", userOGLversion),
_("WARNING"),
wxOK,
this);
if (!hasNotRecentEnoughOpenGLVersionWarningBeenThrownYet)
{
hasNotRecentEnoughOpenGLVersionWarningBeenThrownYet = true;
wxMessageBox(
wxString::Format(
"Your OpenGL version is %s, required version is 2.0\nPlease update your graphics card drivers", userOGLversion),
_("WARNING"),
wxOK,
this);
}

return false;
}

Expand Down
2 changes: 2 additions & 0 deletions src/oglGraph/OpenGLGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ class OpenGLGraph : public wxGLCanvas
bool m_currentlyDrawing;
wxTimer* m_timer;
wxGLContext* m_glContext;

static bool hasNotRecentEnoughOpenGLVersionWarningBeenThrownYet;
};

#endif

0 comments on commit 4c32bdc

Please sign in to comment.