Makefile and adjustments for compiling uart_boot under cygwin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5439 a1c6a512-1295-4272-9138-f99709370657
diff --git a/flash/uart_boot/Makefile b/flash/uart_boot/Makefile
new file mode 100644
index 0000000..f8f9487
--- /dev/null
+++ b/flash/uart_boot/Makefile
@@ -0,0 +1,16 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id$
+#
+# This Makefile currently works for cygwin only!
+
+
+CFLAGS := -O -W -Wall -mno-cygwin
+
+uart_boot: uart_boot.c client.c flash.c uart_win.c
+ $(CC) $(CFLAGS) $+ -o $@
+
diff --git a/flash/uart_boot/client.c b/flash/uart_boot/client.c
index a98edc6..71749a2 100644
--- a/flash/uart_boot/client.c
+++ b/flash/uart_boot/client.c
@@ -15,7 +15,7 @@
if(!UartConfig(serial_handle, 4800, eMARKPARITY, eTWOSTOPBITS, 8))
{
UINT32 dwErr = GET_LAST_ERR();
- printf("Error %d setting up COM params for baudrate byte\n", dwErr);
+ printf("Error %lu setting up COM params for baudrate byte\n", dwErr);
exit(1);
}
@@ -24,7 +24,7 @@
if (result_nbr != 2)
{
UINT32 dwErr = GET_LAST_ERR();
- printf("Error %d setting up COM params for baudrate byte\n", dwErr);
+ printf("Error %lu setting up COM params for baudrate byte\n", dwErr);
}
SLEEP(100); // wait for the chars to be sent, is there a better way?
@@ -48,7 +48,7 @@
if(!UartConfig(serial_handle, 4800, eNOPARITY, eTWOSTOPBITS, 8))
{
UINT32 dwErr = GET_LAST_ERR();
- printf("Error %d setting up COM params for baudrate byte\n", dwErr);
+ printf("Error %lu setting up COM params for baudrate byte\n", dwErr);
exit(1);
}
@@ -66,7 +66,7 @@
if(!UartConfig(serial_handle, 38400, eNOPARITY, eONESTOPBIT, 8))
{
UINT32 dwErr = GET_LAST_ERR();
- printf("Error %d setting up COM params for 1st level loader\n", dwErr);
+ printf("Error %lu setting up COM params for 1st level loader\n", dwErr);
exit(1);
}
@@ -78,7 +78,6 @@
int DownloadByte(tUartHandle serial_handle, unsigned char byte, bool bAck)
{
unsigned char received;
- bool bRecorder = true; // false for player
while (1)
{
@@ -230,7 +229,7 @@
if(!UartConfig(serial_handle, 115200, eNOPARITY, eONESTOPBIT, 8))
{
UINT32 dwErr = GET_LAST_ERR();
- printf("Error %d setting up COM params for baudrate %d\n", dwErr, 115200);
+ printf("Error %lu setting up COM params for baudrate %d\n", dwErr, 115200);
exit(1);
}
diff --git a/flash/uart_boot/client.h b/flash/uart_boot/client.h
index d2ef29a..a5df8c3 100644
--- a/flash/uart_boot/client.h
+++ b/flash/uart_boot/client.h
@@ -18,4 +18,5 @@
int Execute(tUartHandle serial_handle, UINT32 addr, bool bReturns);
-#endif
\ No newline at end of file
+#endif
+
diff --git a/flash/uart_boot/flash.c b/flash/uart_boot/flash.c
index f27bb7e..854de20 100644
--- a/flash/uart_boot/flash.c
+++ b/flash/uart_boot/flash.c
@@ -74,4 +74,5 @@
// UART protocol is slow enough such that I don't have to wait 20us here
}
return 0;
-}
\ No newline at end of file
+}
+
diff --git a/flash/uart_boot/flash.h b/flash/uart_boot/flash.h
index 70c6201..9c69ad4 100644
--- a/flash/uart_boot/flash.h
+++ b/flash/uart_boot/flash.h
@@ -6,4 +6,5 @@
int EraseChip(tUartHandle serial_handle, UINT32 base);
int ProgramBytes(tUartHandle serial_handle, UINT32 address, UINT8* pData, UINT32 size);
-#endif
\ No newline at end of file
+#endif
+
diff --git a/flash/uart_boot/minimon.h b/flash/uart_boot/minimon.h
index 51406d4..69a03b1 100644
--- a/flash/uart_boot/minimon.h
+++ b/flash/uart_boot/minimon.h
@@ -21,3 +21,4 @@
#endif // _MINIMON_H
+
diff --git a/flash/uart_boot/scalar_types.h b/flash/uart_boot/scalar_types.h
index 88d82c4..f3ac1d8 100644
--- a/flash/uart_boot/scalar_types.h
+++ b/flash/uart_boot/scalar_types.h
@@ -41,4 +41,5 @@
-#endif
\ No newline at end of file
+#endif
+
diff --git a/flash/uart_boot/uart.h b/flash/uart_boot/uart.h
index 46b082c..a0c10d1 100644
--- a/flash/uart_boot/uart.h
+++ b/flash/uart_boot/uart.h
@@ -53,4 +53,5 @@
-#endif // _UART_H
\ No newline at end of file
+#endif // _UART_H
+
diff --git a/flash/uart_boot/uart_win.c b/flash/uart_boot/uart_win.c
index 243017a..6e82e95 100644
--- a/flash/uart_boot/uart_win.c
+++ b/flash/uart_boot/uart_win.c
@@ -136,3 +136,4 @@
return;
}
+