wt5001: switch to using new mraa_uart_get_dev_path()

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Jon Trulson
2015-01-21 17:41:35 -07:00
committed by Mihai Tudor Panu
parent 809292630f
commit 328b7638ad
3 changed files with 17 additions and 24 deletions

View File

@ -43,24 +43,10 @@ void printUsage(char *progname)
int main (int argc, char **argv)
{
//! [Interesting]
// Instantiate a WT5001 serial MP3 player on uart 0 (/dev/ttyS0). This
// works for the galileo G2.
// The Edison uses a different serial port, /dev/ttyMFD1, so if you
// are using this example on an Edison board, set the environment
// variable WT5001_SERIAL_PORT to specify the proper port before
// running this example,
// eg: 'WT5001_SERIAL_PORT=/dev/ttyMFD1 ./wt5001-example'
// Instantiate a WT5001 serial MP3 player on uart 0.
// This example was tested on the Grove Serial MP3 module.
const char *defaultPort = "/dev/ttyS0";
char *port = getenv("WT5001_SERIAL_PORT");
if (port)
defaultPort = port;
upm::WT5001* mp3 = new upm::WT5001(0, defaultPort);
upm::WT5001* mp3 = new upm::WT5001(0);
int cmd = -1;
if (argc > 1)