Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor Windows issues #405

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading