bool uart_write(const char * buffer, uint16 size) { Sink sink = StreamUartSink(); uint16 offset = SinkClaim(sink, size); uint8 * address; if (offset == 0xffff) return FALSE; address = SinkMap(sink); memcpy(address + offset, buffer, size); return SinkFlush(sink, size); }
static void scanner_off_state_enter(void) { DEBUG(( "scanner, off state enter... \n" )); update_indication(); #if 0 disable_scanner(); #endif trigger_pull_up(); if (StreamUartSource()) { StreamUartConfigure(VM_UART_RATE_9K6, VM_UART_STOP_ONE, VM_UART_PARITY_NONE); MessageSinkTask(StreamUartSink(), &scanner.task); scanner.uart_initialized = TRUE; } }