/***************************************************************************
- * Copyright (C) 2007-2008 by Øyvind Harboe *
+ * Copyright (C) 2007-2009 by Øyvind Harboe *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
#include <stdio.h>
+#ifdef CYGPKG_HAL_NIOS2
+#define ZY1000_SER_DEV "/dev/uart_0"
+#else
+#define ZY1000_SER_DEV "/dev/ser0"
+
+#endif
+
+
#define MAX_IFS 64
#if defined(CYGPKG_NET_FREEBSD_STACK)
#include <tftp_support.h>
int oldopts = fcntl(session, F_GETFL, 0);
fcntl(session, F_SETFL, oldopts | O_NONBLOCK); //
- int serHandle = open("/dev/ser0", O_RDWR | O_NONBLOCK);
+ int serHandle = open(ZY1000_SER_DEV, O_RDWR | O_NONBLOCK);
if (serHandle < 0)
{
close(session);
int err;
cyg_io_handle_t serial_handle;
- err = cyg_io_lookup("/dev/ser0", &serial_handle);
+ err = cyg_io_lookup(ZY1000_SER_DEV, &serial_handle);
if (err != ENOERR)
{
- LOG_ERROR("/dev/ser0 not found\n");
+ LOG_ERROR("Could not open serial port\n");
return ERROR_FAIL;
}