Hi everyone, sorry if I came of sounding like a dick, that was not my goal, I was just a little meh about having to reflash the OS, I’m 90% sure it will fix the problem after reading the comments it sound like it just needs a resetting, so ill keep a fresh sd card around so I can reset it as needed.
I let the battery run down last night in the hopes it will reset things, ill also drop another sd card in and see if that resets it, it sound like this is a problem as I’m not the only one, any chance of a python lib the force a reset of the oled or something along those lines? Do we know what makes this happen? Are there any best practices, ill explain a little bellow as to what i was doing.
I dont use python and had to do some funky stuff to get the .net sdk working in c++.
A little backstory as to how I was using the oled from c++, I started with the new .net sdk you dropped, I then built a c# lib to run all the pi -top functions, managed oled pages/menu interactions(cup, memory, devices, connections, ect), I then decorate functions with a NativeExpose attribute, for a function to be callable from native code it needs to be static and have a delegate with the same function sig.
I host netcore3.1 in my c++ app, i then have a tool that uses reflection to parse the types in my c# lib and generate c++ classes to wrap the managed functions and extract function pointers, you can then just call the managed functions as you need like normal but from native code.
//Setup the function pointer
typedef void (CORECLR_DELEGATE_CALLTYPE* call_SetCoreValues_fn)(float core0,float core1,float core2,float core3);
call_SetCoreValues_fn SetCoreValues_ptr = nullptr;
//Get the function pointer
rc = load_assembly_and_get_function_pointer_2(
m_NetCoreLoader->GetPath(),
STR(“DotNetLib.FPiTop, DotNetLib”) /type_name/,
STR(“SetCoreValues”) /method_name/,
STR(“DotNetLib.FPiTop+SetCoreValuesDelegate, DotNetLib”) /delegate_type_name/,
nullptr,
(void**)&SetCoreValues_ptr);
//Call the function
if(SetCoreValues_ptr)
{
SetCoreValues_ptr(core0,core1,core2,core3);
}