rpi serial: C++ constructors not getting called
* Make a global * Thanks to pfoetchen + OmniMancer for figuring it out
This commit is contained in:
parent
125c31a827
commit
84882c0039
@ -17,7 +17,8 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
UartPL011* gLoaderUART;
|
||||
UartPL011 gLoaderUART(uart_base_debug());
|
||||
|
||||
|
||||
static int32 sSerialEnabled = 0;
|
||||
static char sBuffer[16384];
|
||||
@ -27,7 +28,7 @@ static uint32 sBufferPosition;
|
||||
static void
|
||||
serial_putc(char c)
|
||||
{
|
||||
gLoaderUART->PutChar(c);
|
||||
gLoaderUART.PutChar(c);
|
||||
}
|
||||
|
||||
|
||||
@ -80,12 +81,8 @@ serial_cleanup(void)
|
||||
extern "C" void
|
||||
serial_init(void)
|
||||
{
|
||||
gLoaderUART = new(nothrow) UartPL011(uart_base_debug());
|
||||
if (gLoaderUART == 0)
|
||||
return;
|
||||
|
||||
gLoaderUART->InitEarly();
|
||||
gLoaderUART->InitPort(9600);
|
||||
gLoaderUART.InitEarly();
|
||||
gLoaderUART.InitPort(9600);
|
||||
|
||||
serial_enable();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user