Skip to content

Commit

Permalink
added
Browse files Browse the repository at this point in the history
  • Loading branch information
maniacbug committed Jun 8, 2011
1 parent 89c2a82 commit aa79084
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions examples/meshping/printf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
Copyright (C) 2011 James Coliz, Jr. <maniacbug@ymail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/

/**
* @file printf.h
*
* Setup necessary to direct stdout to the Arduino Serial library, which
* enables 'printf'
*/

#ifndef __PRINTF_H__
#define __PRINTF_H__

#include "WProgram.h"

int serial_putc( char c, FILE *t )
{
Serial.write( c );

return c;
}

void printf_begin(void)
{
fdevopen( &serial_putc, 0 );
}

#endif // __PRINTF_H__

0 comments on commit aa79084

Please sign in to comment.