6 years, 3 months ago.

Serial write() API compile error

I have two mbed boards, F401RE and LPC1678.

The code below can be compiled when selected platform is F401RE.

Serial pc(USBTX, USBRX);
pc.write((const uint8_t*)gIntBuf, 130*4, (const event_callback_t)NULL, 0);

But, if I selected LPC1678 as platform, then the code have compile error like : Error: Function "mbed::Stream::write" (declared at /extras/mbed/platform/Stream.h', '61') is inaccessible "pc.write((const uint8_t*)gIntBuf, 130*4, (const event_callback_t)NULL, 0);"

How can I resolve this situation ?

1 Answer

6 years, 3 months ago.

int count = 0;
while (count < 130*4) {
  pc.putc(*((char*)gIntBuf +count));
  count++;
}

Accepted Answer