summaryrefslogtreecommitdiffstats
path: root/c/src
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2009-11-29 14:53:02 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2009-11-29 14:53:02 +0000
commit32b8506b2409a01d434dd0ab5024c7718852ebcb (patch)
tree24b3215851217bf05c40cc8a62af4d021019b5d1 /c/src
parentWhitespace removal. (diff)
downloadrtems-32b8506b2409a01d434dd0ab5024c7718852ebcb.tar.bz2
Whitespace removal.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/arm/csb336/console/uart.c62
-rw-r--r--c/src/lib/libbsp/arm/csb336/include/bsp.h2
-rw-r--r--c/src/lib/libbsp/arm/csb336/network/lan91c11x.c70
-rw-r--r--c/src/lib/libbsp/arm/csb336/network/lan91c11x.h2
-rw-r--r--c/src/lib/libbsp/arm/csb336/network/network.c168
-rw-r--r--c/src/lib/libbsp/arm/csb336/start/start.S38
-rw-r--r--c/src/lib/libbsp/arm/csb337/console/fbcons.c30
-rwxr-xr-xc/src/lib/libbsp/arm/csb337/console/font8x16.h4
-rw-r--r--c/src/lib/libbsp/arm/csb337/console/sed1356.c14
-rwxr-xr-xc/src/lib/libbsp/arm/csb337/console/sed1356_16bit.h176
-rw-r--r--c/src/lib/libbsp/arm/csb337/console/uarts.c22
-rw-r--r--c/src/lib/libbsp/arm/csb337/include/bsp.h2
-rw-r--r--c/src/lib/libbsp/arm/csb337/network/network.c6
-rw-r--r--c/src/lib/libbsp/arm/csb337/start/start.S34
-rw-r--r--c/src/lib/libbsp/arm/csb337/startup/bspreset.c2
-rw-r--r--c/src/lib/libbsp/arm/csb337/startup/bspstart.c10
-rw-r--r--c/src/lib/libbsp/arm/edb7312/irq/irq.h6
-rw-r--r--c/src/lib/libbsp/arm/edb7312/start/start.S2
-rw-r--r--c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c2
-rw-r--r--c/src/lib/libbsp/arm/gba/start/start.S2
-rw-r--r--c/src/lib/libbsp/arm/gdbarmsim/start/start.S56
-rw-r--r--c/src/lib/libbsp/arm/gdbarmsim/startup/syscalls.c88
-rw-r--r--c/src/lib/libbsp/arm/gp32/console/uart.c48
-rw-r--r--c/src/lib/libbsp/arm/gp32/include/bsp.h4
-rw-r--r--c/src/lib/libbsp/arm/gp32/smc/smc.c78
-rw-r--r--c/src/lib/libbsp/arm/gp32/start/start.S38
-rw-r--r--c/src/lib/libbsp/arm/gp32/startup/bspreset.c2
-rw-r--r--c/src/lib/libbsp/arm/gp32/startup/bspstart.c6
-rwxr-xr-xc/src/lib/libbsp/arm/gumstix/console/uarts.c6
-rw-r--r--c/src/lib/libbsp/arm/gumstix/fb/fb.c18
-rw-r--r--c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c18
-rwxr-xr-xc/src/lib/libbsp/arm/gumstix/start/start.S30
-rwxr-xr-xc/src/lib/libbsp/arm/gumstix/startup/memmap.c2
-rw-r--r--c/src/lib/libbsp/arm/lpc24xx/clock/clock-config.c6
-rw-r--r--c/src/lib/libbsp/arm/lpc24xx/console/console-config.c2
-rw-r--r--c/src/lib/libbsp/arm/lpc24xx/include/bsp.h2
-rw-r--r--c/src/lib/libbsp/arm/lpc24xx/include/lpc24xx.h476
-rw-r--r--c/src/lib/libbsp/arm/lpc24xx/misc/dma.c6
-rw-r--r--c/src/lib/libbsp/arm/lpc24xx/misc/io.c2
-rw-r--r--c/src/lib/libbsp/arm/lpc24xx/network/network.c14
-rw-r--r--c/src/lib/libbsp/arm/lpc24xx/startup/bspstarthooks.c56
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm7/source/wifi_arm7.c24
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm7/source/wifi_arm7.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP.c2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.c6
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.h6
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Config.h16
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DHCP.c24
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DHCP.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DNS.c14
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DNS.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Hub.c8
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Hub.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ICMP.c2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ICMP.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_IP.c4
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_IP.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_TCP.c34
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_TCP.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_UDP.c6
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_UDP.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_memblock.c2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_memblock.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_sockets.c8
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_sockets.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/wifi_arm9.c28
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/arm9/source/wifi_arm9.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/common/source/dsregs.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/common/source/spinlock.S60
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/common/source/spinlock.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/common/source/wifi_shared.h16
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/include/dswifi7.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/include/dswifi9.h24
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/include/netdb.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/include/netinet/in.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/dswifi/include/sgIP_errno.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/fb/fb.c4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/gba/include/fat.h10
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/include/fat.h10
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/nds/include/fat.h10
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/bit_ops.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/cache.c24
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/cache.h12
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/common.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/directory.c78
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/directory.h10
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc.c18
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc.h8
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc_io.h6
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_cf_common.c52
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_cf_common.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_dldi.S14
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_dldi.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_efa2.c14
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_efa2.h6
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.c18
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3_common.c10
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3_common.h6
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3cf.c2
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3cf.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3sd.c78
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3sd.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_mpcf.c2
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_mpcf.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_njsd.c54
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_njsd.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_nmmc.c60
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_nmmc.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sc_common.c6
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sc_common.h6
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sccf.c4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sccf.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd.c70
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd_s.S44
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sd_common.c60
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sd_common.h12
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/fatdir.c122
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/fatdir.h10
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/fatfile.c210
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/fatfile.h10
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/file_allocation_table.c78
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/file_allocation_table.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/filetime.c28
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/filetime.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/libfat.c24
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/mem_allocate.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/partition.c84
-rw-r--r--c/src/lib/libbsp/arm/nds/libfat/source/partition.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/basicARM7/source/defaultARM7.c6
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm7/audio.h8
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm7/clock.h10
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/boxtest.h10
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/cache.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/console.h8
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/image.h144
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/input.h49
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/math.h142
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/ndsmotion.h8
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/pcx.h152
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/postest.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/rumble.h148
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/sound.h144
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/sprite.h20
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/trig_lut.h144
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/video.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/videoGL.h224
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/card.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/interrupts.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/registers_alt.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/reload.h36
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/system.h4
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/include/nds/timers.h32
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm7/clock.c14
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm7/touch.c2
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm7/userSettings.c12
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/boxtest.c2
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/console.c18
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/gurumeditation.c2
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/image.c154
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/keys.c140
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/ndsmotion.c20
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/pcx.c170
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/rumble.c152
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/sound.c140
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/touch.c146
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/arm9/videoGL.c40
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/common/biosCalls.S30
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/common/card.c16
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/common/gbfs.c144
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/common/interruptDispatcher.S56
-rw-r--r--c/src/lib/libbsp/arm/nds/libnds/source/common/interrupts.c37
-rw-r--r--c/src/lib/libbsp/arm/nds/tools/bin2s.c38
-rw-r--r--c/src/lib/libbsp/arm/nds/tools/ndstool/include/ndstree.h2
-rw-r--r--c/src/lib/libbsp/arm/nds/tools/ndstool/include/sha1.h12
-rw-r--r--c/src/lib/libbsp/arm/rtl22xx/console/uart.c66
-rw-r--r--c/src/lib/libbsp/arm/rtl22xx/include/bsp.h6
-rw-r--r--c/src/lib/libbsp/arm/rtl22xx/start/start.S36
-rw-r--r--c/src/lib/libbsp/arm/rtl22xx/startup/bspreset.c4
-rw-r--r--c/src/lib/libbsp/arm/shared/abort/abort.c14
-rw-r--r--c/src/lib/libbsp/arm/shared/abort/simple_abort.c8
-rw-r--r--c/src/lib/libbsp/lm32/lm32_evr/include/bsp.h6
-rw-r--r--c/src/lib/libbsp/lm32/lm32_evr/include/coverhd.h6
-rw-r--r--c/src/lib/libbsp/lm32/shared/clock/ckinit.c8
-rw-r--r--c/src/lib/libbsp/lm32/shared/console/uart.c2
-rw-r--r--c/src/lib/libbsp/lm32/shared/gdbstub/lm32-debug.S42
-rw-r--r--c/src/lib/libbsp/lm32/shared/gdbstub/lm32-stub.c120
-rw-r--r--c/src/lib/libbsp/lm32/shared/start/start.S22
-rw-r--r--c/src/lib/libbsp/lm32/shared/tsmac/tsmac.c42
191 files changed, 4097 insertions, 2211 deletions
diff --git a/c/src/lib/libbsp/arm/csb336/console/uart.c b/c/src/lib/libbsp/arm/csb336/console/uart.c
index 7e5fc96b0d..3db7888435 100644
--- a/c/src/lib/libbsp/arm/csb336/console/uart.c
+++ b/c/src/lib/libbsp/arm/csb336/console/uart.c
@@ -37,7 +37,7 @@ static void imx_uart_init(int minor);
static void imx_uart_set_baud(int, int);
static int imx_uart_poll_write(int, const char *, int);
-#if defined(USE_INTERRUPTS)
+#if defined(USE_INTERRUPTS)
static void imx_uart_tx_isr(rtems_irq_hdl_param);
static void imx_uart_rx_isr(rtems_irq_hdl_param);
static void imx_uart_isr_on(const rtems_irq_connect_data *irq);
@@ -49,7 +49,7 @@ static int imx_uart_intr_write(int, const char *, int);
/* TERMIOS callbacks */
-#if defined(USE_INTERRUPTS)
+#if defined(USE_INTERRUPTS)
rtems_termios_callbacks imx_uart_cbacks = {
.firstOpen = imx_uart_first_open,
.lastClose = imx_uart_last_close,
@@ -60,7 +60,7 @@ rtems_termios_callbacks imx_uart_cbacks = {
.startRemoteTx = NULL,
.outputUsesInterrupts = 1,
};
-#else
+#else
rtems_termios_callbacks imx_uart_cbacks = {
.firstOpen = imx_uart_first_open,
.lastClose = imx_uart_last_close,
@@ -73,7 +73,7 @@ rtems_termios_callbacks imx_uart_cbacks = {
};
#endif
-#if defined(USE_INTERRUPTS)
+#if defined(USE_INTERRUPTS)
static rtems_irq_connect_data imx_uart_tx_isr_data[NUM_DEVS];
static rtems_irq_connect_data imx_uart_rx_isr_data[NUM_DEVS];
#endif
@@ -141,7 +141,7 @@ rtems_device_driver console_open(
return rc;
}
-
+
rtems_device_driver console_close(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -150,7 +150,7 @@ rtems_device_driver console_close(
{
return rtems_termios_close(arg);
}
-
+
rtems_device_driver console_read(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -159,7 +159,7 @@ rtems_device_driver console_read(
{
return rtems_termios_read(arg);
}
-
+
rtems_device_driver console_write(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -168,7 +168,7 @@ rtems_device_driver console_write(
{
return rtems_termios_write(arg);
}
-
+
rtems_device_driver console_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -186,25 +186,25 @@ static void imx_uart_init(int minor)
imx_uart_data[minor].idx = 0;
if (minor == 0) {
-#if defined(USE_INTERRUPTS)
+#if defined(USE_INTERRUPTS)
imx_uart_tx_isr_data[minor].name = BSP_INT_UART1_TX;
imx_uart_rx_isr_data[minor].name = BSP_INT_UART1_RX;
#endif
- imx_uart_data[minor].regs =
+ imx_uart_data[minor].regs =
(mc9328mxl_uart_regs_t *) MC9328MXL_UART1_BASE;
} else if (minor == 1) {
-#if defined(USE_INTERRUPTS)
+#if defined(USE_INTERRUPTS)
imx_uart_tx_isr_data[minor].name = BSP_INT_UART2_TX;
imx_uart_rx_isr_data[minor].name = BSP_INT_UART2_RX;
#endif
- imx_uart_data[minor].regs =
+ imx_uart_data[minor].regs =
(mc9328mxl_uart_regs_t *) MC9328MXL_UART2_BASE;
} else {
- rtems_panic("%s:%d Unknown UART minor number %d\n",
- __FUNCTION__, __LINE__, minor);
+ rtems_panic("%s:%d Unknown UART minor number %d\n",
+ __FUNCTION__, __LINE__, minor);
}
-#if defined(USE_INTERRUPTS)
+#if defined(USE_INTERRUPTS)
imx_uart_tx_isr_data[minor].hdl = imx_uart_tx_isr;
imx_uart_tx_isr_data[minor].handle = &imx_uart_data[minor];
imx_uart_tx_isr_data[minor].on = imx_uart_isr_on;
@@ -234,8 +234,8 @@ static void imx_uart_init(int minor)
imx_uart_data[minor].regs->cr4 = 0;
imx_uart_data[minor].regs->fcr = (
- MC9328MXL_UART_FCR_TXTL(32) |
- MC9328MXL_UART_FCR_RFDIV_1 |
+ MC9328MXL_UART_FCR_TXTL(32) |
+ MC9328MXL_UART_FCR_RFDIV_1 |
MC9328MXL_UART_FCR_RXTL(1));
imx_uart_set_baud(minor, 38400);
@@ -247,8 +247,8 @@ static int imx_uart_first_open(int major, int minor, void *arg)
rtems_libio_open_close_args_t *args = arg;
imx_uart_data[minor].tty = args->iop->data1;
-
-#if defined(USE_INTERRUPTS)
+
+#if defined(USE_INTERRUPTS)
BSP_install_rtems_irq_handler(&imx_uart_tx_isr_data[minor]);
BSP_install_rtems_irq_handler(&imx_uart_rx_isr_data[minor]);
@@ -260,7 +260,7 @@ static int imx_uart_first_open(int major, int minor, void *arg)
static int imx_uart_last_close(int major, int minor, void *arg)
{
-#if defined(USE_INTERRUPTS)
+#if defined(USE_INTERRUPTS)
BSP_remove_rtems_irq_handler(&imx_uart_tx_isr_data[minor]);
BSP_remove_rtems_irq_handler(&imx_uart_rx_isr_data[minor]);
#endif
@@ -268,7 +268,7 @@ static int imx_uart_last_close(int major, int minor, void *arg)
return 0;
}
-static int imx_uart_poll_read(int minor)
+static int imx_uart_poll_read(int minor)
{
if (imx_uart_data[minor].regs->sr2 & MC9328MXL_UART_SR2_RDR) {
return imx_uart_data[minor].regs->rxd & 0xff;
@@ -278,7 +278,7 @@ static int imx_uart_poll_read(int minor)
}
-static int imx_uart_poll_write(int minor, const char *buf, int len)
+static int imx_uart_poll_write(int minor, const char *buf, int len)
{
int i;
for (i = 0; i < len; i++) {
@@ -293,22 +293,22 @@ static int imx_uart_poll_write(int minor, const char *buf, int len)
}
-#if defined(USE_INTERRUPTS)
+#if defined(USE_INTERRUPTS)
static int imx_uart_intr_write(int minor, const char *buf, int len)
{
imx_uart_data[minor].buf = buf;
imx_uart_data[minor].len = len;
imx_uart_data[minor].idx = 0;
-
+
imx_uart_data[minor].regs->cr1 |= MC9328MXL_UART_CR1_TXMPTYEN;
return 1;
}
#endif
-
+
/* This is for setting baud rate, bits, etc. */
-static int imx_uart_set_attrs(int minor, const struct termios *t)
+static int imx_uart_set_attrs(int minor, const struct termios *t)
{
int baud;
@@ -318,7 +318,7 @@ static int imx_uart_set_attrs(int minor, const struct termios *t)
return 0;
}
-#if defined(USE_INTERRUPTS)
+#if defined(USE_INTERRUPTS)
static void imx_uart_isr_on(const rtems_irq_connect_data *irq)
{
MC9328MXL_AITC_INTENNUM = irq->name;
@@ -403,12 +403,12 @@ static void imx_uart_set_baud(int minor, int baud)
case MC9328MXL_UART_FCR_RFDIV_6: ref_freq = perclk1/6; break;
case MC9328MXL_UART_FCR_RFDIV_7: ref_freq = perclk1/7; break;
default:
- rtems_panic("%s:%d Unknown RFDIV: 0x%x",
+ rtems_panic("%s:%d Unknown RFDIV: 0x%x",
__FUNCTION__, __LINE__,
fcr & MC9328MXL_UART_FCR_RFDIV_MASK);
break;
}
-
+
denom = ref_freq / baud;
imx_uart_data[minor].regs->bir = 0xf;
@@ -416,7 +416,7 @@ static void imx_uart_set_baud(int minor, int baud)
}
-/*
+/*
* Polled, non-blocking read from UART
*/
int imx_uart_poll_read_char(int minor)
@@ -424,7 +424,7 @@ int imx_uart_poll_read_char(int minor)
return imx_uart_poll_read(minor);
}
-/*
+/*
* Polled, blocking write from UART
*/
void imx_uart_poll_write_char(int minor, char c)
diff --git a/c/src/lib/libbsp/arm/csb336/include/bsp.h b/c/src/lib/libbsp/arm/csb336/include/bsp.h
index b9770e0ecf..c90879a9cd 100644
--- a/c/src/lib/libbsp/arm/csb336/include/bsp.h
+++ b/c/src/lib/libbsp/arm/csb336/include/bsp.h
@@ -39,7 +39,7 @@ int get_perclk1_freq(void);
extern struct rtems_bsdnet_ifconfig *config;
/* Change these to match your board */
-int rtems_mc9328mxl_enet_attach(struct rtems_bsdnet_ifconfig *config,
+int rtems_mc9328mxl_enet_attach(struct rtems_bsdnet_ifconfig *config,
void *chip);
#define RTEMS_BSP_NETWORK_DRIVER_NAME "eth0"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_mc9328mxl_enet_attach
diff --git a/c/src/lib/libbsp/arm/csb336/network/lan91c11x.c b/c/src/lib/libbsp/arm/csb336/network/lan91c11x.c
index 3377c601ac..3c54a3c39d 100644
--- a/c/src/lib/libbsp/arm/csb336/network/lan91c11x.c
+++ b/c/src/lib/libbsp/arm/csb336/network/lan91c11x.c
@@ -82,29 +82,29 @@ uint16_t lan91c11x_read_phy_reg(int reg)
{
int i;
uint16_t mask;
- uint16_t bits[64];
+ uint16_t bits[64];
int clk_idx = 0;
int input_idx = 0;
uint16_t phydata;
-
+
/* 32 consecutive ones on MDO to establish sync */
for (i = 0; i < 32; ++i) {
bits[clk_idx++] = LAN91C11X_MGMT_MDOE | LAN91C11X_MGMT_MDO;
}
-
+
/* Start code <01> */
bits[clk_idx++] = LAN91C11X_MGMT_MDOE;
bits[clk_idx++] = LAN91C11X_MGMT_MDOE | LAN91C11X_MGMT_MDO;
-
+
/* Read command <10> */
bits[clk_idx++] = LAN91C11X_MGMT_MDOE | LAN91C11X_MGMT_MDO;
bits[clk_idx++] = LAN91C11X_MGMT_MDOE;
-
+
/* Output the PHY address, msb first - Internal PHY is address 0 */
for (i = 0; i < 5; ++i) {
bits[clk_idx++] = LAN91C11X_MGMT_MDOE;
}
-
+
/* Output the phy register number, msb first */
mask = 0x10;
for (i = 0; i < 5; ++i) {
@@ -113,57 +113,57 @@ uint16_t lan91c11x_read_phy_reg(int reg)
} else {
bits[clk_idx++] = LAN91C11X_MGMT_MDOE;
}
-
-
+
+
/* Shift to next lowest bit */
mask >>= 1;
}
-
+
/* 1 bit time for turnaround */
bits[clk_idx++] = 0;
-
+
/* Input starts at this bit time */
input_idx = clk_idx;
-
+
/* Will input 16 bits */
for (i = 0; i < 16; ++i) {
bits[clk_idx++] = 0;
}
-
+
/* Final clock bit */
bits[clk_idx++] = 0;
-
+
/* Turn off all MII Interface bits */
- lan91c11x_write_reg(LAN91C11X_MGMT,
+ lan91c11x_write_reg(LAN91C11X_MGMT,
lan91c11x_read_reg(LAN91C11X_MGMT) & 0xfff0);
-
+
/* Clock all 64 cycles */
for (i = 0; i < sizeof bits; ++i) {
/* Clock Low - output data */
lan91c11x_write_reg(LAN91C11X_MGMT, bits[i]);
rtems_task_wake_after(1);
-
+
/* Clock Hi - input data */
lan91c11x_write_reg(LAN91C11X_MGMT, bits[i] | LAN91C11X_MGMT_MCLK);
rtems_task_wake_after(1);
bits[i] |= lan91c11x_read_reg(LAN91C11X_MGMT) & LAN91C11X_MGMT_MDI;
}
-
+
/* Return to idle state */
/* Set clock to low, data to low, and output tristated */
lan91c11x_write_reg(LAN91C11X_MGMT, lan91c11x_read_reg(LAN91C11X_MGMT) & 0xfff0);
rtems_task_wake_after(1);
-
+
/* Recover input data */
phydata = 0;
for (i = 0; i < 16; ++i) {
phydata <<= 1;
-
+
if (bits[input_idx++] & LAN91C11X_MGMT_MDI) {
phydata |= 0x0001;
}
}
-
+
return phydata;
}
@@ -173,27 +173,27 @@ void lan91c11x_write_phy_reg(int reg, uint16_t phydata)
{
int i;
ushort mask;
- ushort bits[64];
+ ushort bits[64];
int clk_idx = 0;
-
+
/* 32 consecutive ones on MDO to establish sync */
for (i = 0; i < 32; ++i) {
bits[clk_idx++] = LAN91C11X_MGMT_MDOE | LAN91C11X_MGMT_MDO;
}
-
+
/* Start code <01> */
bits[clk_idx++] = LAN91C11X_MGMT_MDOE;
bits[clk_idx++] = LAN91C11X_MGMT_MDOE | LAN91C11X_MGMT_MDO;
-
+
/* Write command <01> */
bits[clk_idx++] = LAN91C11X_MGMT_MDOE;
bits[clk_idx++] = LAN91C11X_MGMT_MDOE | LAN91C11X_MGMT_MDO;
-
+
/* Output the PHY address, msb first - Internal PHY is address 0 */
for (i = 0; i < 5; ++i) {
bits[clk_idx++] = LAN91C11X_MGMT_MDOE;
}
-
+
/* Output the phy register number, msb first */
mask = 0x10;
for (i = 0; i < 5; ++i) {
@@ -202,15 +202,15 @@ void lan91c11x_write_phy_reg(int reg, uint16_t phydata)
} else {
bits[clk_idx++] = LAN91C11X_MGMT_MDOE;
}
-
+
/* Shift to next lowest bit */
mask >>= 1;
}
-
+
/* 2 extra bit times for turnaround */
bits[clk_idx++] = 0;
bits[clk_idx++] = 0;
-
+
/* Write out 16 bits of data, msb first */
mask = 0x8000;
for (i = 0; i < 16; ++i) {
@@ -225,27 +225,27 @@ void lan91c11x_write_phy_reg(int reg, uint16_t phydata)
}
/* Turn off all MII Interface bits */
- lan91c11x_write_reg(LAN91C11X_MGMT,
+ lan91c11x_write_reg(LAN91C11X_MGMT,
lan91c11x_read_reg(LAN91C11X_MGMT) & 0xfff0);
-
+
/* Clock all 64 cycles */
for (i = 0; i < sizeof bits; ++i) {
/* Clock Low - output data */
lan91c11x_write_reg(LAN91C11X_MGMT, bits[i]);
rtems_task_wake_after(1);
-
+
/* Clock Hi - input data */
lan91c11x_write_reg(LAN91C11X_MGMT, bits[i] | LAN91C11X_MGMT_MCLK);
rtems_task_wake_after(1);
bits[i] |= lan91c11x_read_reg(LAN91C11X_MGMT) & LAN91C11X_MGMT_MDI;
}
-
+
/* Return to idle state */
/* Set clock to low, data to low, and output tristated */
- lan91c11x_write_reg(LAN91C11X_MGMT,
+ lan91c11x_write_reg(LAN91C11X_MGMT,
lan91c11x_read_reg(LAN91C11X_MGMT) & 0xfff0);
rtems_task_wake_after(1);
-
+
}
diff --git a/c/src/lib/libbsp/arm/csb336/network/lan91c11x.h b/c/src/lib/libbsp/arm/csb336/network/lan91c11x.h
index 85c7e3262c..f379b25df7 100644
--- a/c/src/lib/libbsp/arm/csb336/network/lan91c11x.h
+++ b/c/src/lib/libbsp/arm/csb336/network/lan91c11x.h
@@ -29,7 +29,7 @@ void lan91c11x_lock(void);
#define LAN91C11X_BASE_ADDR 0x12000000
#define LAN91C11X_REG(_b_, _r_) ((((_b_) & 0xf) << 4) | ((_r_) & 0xf))
-
+
#define LAN91C11X_TCR (LAN91C11X_REG(0, 0x0))
#define LAN91C11X_EPHSTAT (LAN91C11X_REG(0, 0x2))
diff --git a/c/src/lib/libbsp/arm/csb336/network/network.c b/c/src/lib/libbsp/arm/csb336/network/network.c
index ea5adbb406..fa6f903a4d 100644
--- a/c/src/lib/libbsp/arm/csb336/network/network.c
+++ b/c/src/lib/libbsp/arm/csb336/network/network.c
@@ -77,13 +77,13 @@ typedef struct
* This entry *must* be the first in the sonic_softc structure.
*/
struct arpcom arpcom;
-
+
int accept_bcast;
-
+
/* Tasks waiting for interrupts */
rtems_id rx_task;
rtems_id tx_task;
-
+
eth_stats_t stats;
} mc9328mxl_enet_softc_t;
@@ -92,7 +92,7 @@ static mc9328mxl_enet_softc_t softc;
/* function prototypes */
-int rtems_mc9328mxl_enet_attach(struct rtems_bsdnet_ifconfig *config,
+int rtems_mc9328mxl_enet_attach(struct rtems_bsdnet_ifconfig *config,
void *chip);
void mc9328mxl_enet_init(void *arg);
void mc9328mxl_enet_init_hw(mc9328mxl_enet_softc_t *sc);
@@ -102,7 +102,7 @@ void mc9328mxl_enet_tx_task (void *arg);
void mc9328mxl_enet_sendpacket (struct ifnet *ifp, struct mbuf *m);
void mc9328mxl_enet_rx_task(void *arg);
void mc9328mxl_enet_stats(mc9328mxl_enet_softc_t *sc);
-static int mc9328mxl_enet_ioctl(struct ifnet *ifp,
+static int mc9328mxl_enet_ioctl(struct ifnet *ifp,
ioctl_command_t command, caddr_t data);
@@ -116,7 +116,7 @@ int rtems_mc9328mxl_enet_attach (
int unitnumber;
char *unitname;
int tmp;
-
+
/*
* Parse driver name
*/
@@ -124,7 +124,7 @@ int rtems_mc9328mxl_enet_attach (
if (unitnumber < 0) {
return 0;
}
-
+
/*
* Is driver free?
*/
@@ -138,11 +138,11 @@ int rtems_mc9328mxl_enet_attach (
printf ("Driver already in use.\n");
return 0;
}
-
+
/* zero out the control structure */
memset( &softc, 0, sizeof(softc) );
-
-
+
+
/* set the MAC address */
tmp = lan91c11x_read_reg(LAN91C11X_IA0);
softc.arpcom.ac_enaddr[0] = tmp & 0xff;
@@ -163,7 +163,7 @@ int rtems_mc9328mxl_enet_attach (
}
softc.accept_bcast = !config->ignore_broadcast;
-
+
/*
* Set up network interface values
*/
@@ -179,7 +179,7 @@ int rtems_mc9328mxl_enet_attach (
if (ifp->if_snd.ifq_maxlen == 0) {
ifp->if_snd.ifq_maxlen = ifqmaxlen;
}
-
+
/* Attach the interface */
if_attach (ifp);
ether_ifattach (ifp);
@@ -188,52 +188,52 @@ int rtems_mc9328mxl_enet_attach (
void mc9328mxl_enet_init(void *arg)
{
- mc9328mxl_enet_softc_t *sc = arg;
+ mc9328mxl_enet_softc_t *sc = arg;
struct ifnet *ifp = &sc->arpcom.ac_if;
-
- /*
- *This is for stuff that only gets done once (mc9328mxl_enet_init()
- * gets called multiple times
+
+ /*
+ *This is for stuff that only gets done once (mc9328mxl_enet_init()
+ * gets called multiple times
*/
if (sc->tx_task == 0)
{
/* Set up ENET hardware */
mc9328mxl_enet_init_hw(sc);
-
+
/* Start driver tasks */
- sc->rx_task = rtems_bsdnet_newproc("ENrx",
- 4096,
- mc9328mxl_enet_rx_task,
+ sc->rx_task = rtems_bsdnet_newproc("ENrx",
+ 4096,
+ mc9328mxl_enet_rx_task,
sc);
- sc->tx_task = rtems_bsdnet_newproc("ENtx",
- 4096,
- mc9328mxl_enet_tx_task,
+ sc->tx_task = rtems_bsdnet_newproc("ENtx",
+ 4096,
+ mc9328mxl_enet_tx_task,
sc);
} /* if tx_task */
-
+
/* Configure for promiscuous if needed */
if (ifp->if_flags & IFF_PROMISC) {
- lan91c11x_write_reg(LAN91C11X_RCR,
+ lan91c11x_write_reg(LAN91C11X_RCR,
(lan91c11x_read_reg(LAN91C11X_RCR) |
LAN91C11X_RCR_PRMS));
}
-
-
+
+
/*
* Tell the world that we're running.
*/
ifp->if_flags |= IFF_RUNNING;
-
+
/* Enable TX/RX */
- lan91c11x_write_reg(LAN91C11X_TCR,
+ lan91c11x_write_reg(LAN91C11X_TCR,
(lan91c11x_read_reg(LAN91C11X_TCR) |
LAN91C11X_TCR_TXENA));
- lan91c11x_write_reg(LAN91C11X_RCR,
+ lan91c11x_write_reg(LAN91C11X_RCR,
(lan91c11x_read_reg(LAN91C11X_RCR) |
LAN91C11X_RCR_RXEN));
-
+
} /* mc9328mxl_enet_init() */
@@ -254,7 +254,7 @@ void mc9328mxl_enet_init_hw(mc9328mxl_enet_softc_t *sc)
stat = lan91c11x_read_phy_reg(PHY_STAT);
-
+
if(stat & PHY_STAT_CAPT4) {
my |= PHY_ADV_T4;
}
@@ -274,22 +274,22 @@ void mc9328mxl_enet_init_hw(mc9328mxl_enet_softc_t *sc)
if(stat & PHY_STAT_CAPTH) {
my |= PHY_ADV_10HDX;
}
-
+
my |= PHY_ADV_CSMA;
-
+
lan91c11x_write_phy_reg(PHY_AD, my);
/* Enable Autonegotiation */
#if 0
- lan91c11x_write_phy_reg(PHY_CTRL,
+ lan91c11x_write_phy_reg(PHY_CTRL,
(PHY_CTRL_ANEGEN | PHY_CTRL_ANEGRST));
#endif
/* Enable full duplex, let MAC take care
* of padding and CRC.
*/
- lan91c11x_write_reg(LAN91C11X_TCR,
+ lan91c11x_write_reg(LAN91C11X_TCR,
(LAN91C11X_TCR_PADEN |
LAN91C11X_TCR_SWFDUP));
@@ -297,7 +297,7 @@ void mc9328mxl_enet_init_hw(mc9328mxl_enet_softc_t *sc)
lan91c11x_write_reg(LAN91C11X_RCR, 0);
/* Enable auto-negotiation, LEDA is link, LEDB is traffic */
- lan91c11x_write_reg(LAN91C11X_RPCR,
+ lan91c11x_write_reg(LAN91C11X_RPCR,
(LAN91C11X_RPCR_ANEG |
LAN91C11X_RPCR_LS2B));
@@ -308,9 +308,9 @@ void mc9328mxl_enet_init_hw(mc9328mxl_enet_softc_t *sc)
/* Disable error interrupts, enable auto release */
lan91c11x_write_reg(LAN91C11X_CTRL, LAN91C11X_CTRL_AUTO);
-
+
/* Reset MMU */
- lan91c11x_write_reg(LAN91C11X_MMUCMD,
+ lan91c11x_write_reg(LAN91C11X_MMUCMD,
LAN91C11X_MMUCMD_RESETMMU );
@@ -324,7 +324,7 @@ void mc9328mxl_enet_init_hw(mc9328mxl_enet_softc_t *sc)
/* Enable interrupts on GPIO Port A3 */
/* Make pin 3 an input */
- MC9328MXL_GPIOA_DDIR &= ~bit(3);
+ MC9328MXL_GPIOA_DDIR &= ~bit(3);
/* Use GPIO function for pin 3 */
MC9328MXL_GPIOA_GIUS |= bit(3);
@@ -338,13 +338,13 @@ void mc9328mxl_enet_init_hw(mc9328mxl_enet_softc_t *sc)
/* Install the interrupt handler */
BSP_install_rtems_irq_handler(&mc9328mxl_enet_isr_data);
-
+
} /* mc9328mxl_enet_init_hw() */
void mc9328mxl_enet_start(struct ifnet *ifp)
{
mc9328mxl_enet_softc_t *sc = ifp->if_softc;
-
+
rtems_event_send(sc->tx_task, START_TRANSMIT_EVENT);
ifp->if_flags |= IFF_OACTIVE;
}
@@ -352,19 +352,19 @@ void mc9328mxl_enet_start(struct ifnet *ifp)
void mc9328mxl_enet_stop (mc9328mxl_enet_softc_t *sc)
{
struct ifnet *ifp = &sc->arpcom.ac_if;
-
+
ifp->if_flags &= ~IFF_RUNNING;
-
+
/* Stop the transmitter and receiver. */
- lan91c11x_write_reg(LAN91C11X_TCR,
- (lan91c11x_read_reg(LAN91C11X_TCR) &
+ lan91c11x_write_reg(LAN91C11X_TCR,
+ (lan91c11x_read_reg(LAN91C11X_TCR) &
~LAN91C11X_TCR_TXENA));
- lan91c11x_write_reg(LAN91C11X_RCR,
- (lan91c11x_read_reg(LAN91C11X_RCR) &
+ lan91c11x_write_reg(LAN91C11X_RCR,
+ (lan91c11x_read_reg(LAN91C11X_RCR) &
~LAN91C11X_RCR_RXEN));
-
+
}
/*
@@ -376,7 +376,7 @@ void mc9328mxl_enet_tx_task(void *arg)
struct ifnet *ifp = &sc->arpcom.ac_if;
struct mbuf *m;
rtems_event_set events;
-
+
for (;;)
{
rtems_bsdnet_event_receive(
@@ -384,7 +384,7 @@ void mc9328mxl_enet_tx_task(void *arg)
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
&events);
-
+
/* Send packets till queue is empty */
for (;;)
{
@@ -395,7 +395,7 @@ void mc9328mxl_enet_tx_task(void *arg)
}
mc9328mxl_enet_sendpacket (ifp, m);
softc.stats.tx_packets++;
-
+
}
ifp->if_flags &= ~IFF_OACTIVE;
}
@@ -419,7 +419,7 @@ void mc9328mxl_enet_sendpacket (struct ifnet *ifp, struct mbuf *m)
} while (l != NULL);
/* Allocate a TX buffer */
- lan91c11x_write_reg(LAN91C11X_MMUCMD,
+ lan91c11x_write_reg(LAN91C11X_MMUCMD,
(LAN91C11X_MMUCMD_ALLOCTX |
(size >> 8)));
@@ -446,18 +446,18 @@ void mc9328mxl_enet_sendpacket (struct ifnet *ifp, struct mbuf *m)
if (size & 1) {
size++;
}
- lan91c11x_write_reg(LAN91C11X_DATA, size + 6);
+ lan91c11x_write_reg(LAN91C11X_DATA, size + 6);
lan91c11x_lock();
/* Copy the mbuf */
- l = m;
+ l = m;
start = 0;
d = 0;
while (l != NULL)
{
uint8_t *data;
-
+
data = mtod(l, uint8_t *);
for (i = start; i < l->m_len; i++) {
@@ -474,10 +474,10 @@ void mc9328mxl_enet_sendpacket (struct ifnet *ifp, struct mbuf *m)
l = l->m_next;
}
-
+
/* write control byte */
if (i & 1) {
- lan91c11x_write_reg_fast(LAN91C11X_DATA,
+ lan91c11x_write_reg_fast(LAN91C11X_DATA,
htons(LAN91C11X_PKT_CTRL_ODD | d));
} else {
lan91c11x_write_reg_fast(LAN91C11X_DATA, 0);
@@ -486,18 +486,18 @@ void mc9328mxl_enet_sendpacket (struct ifnet *ifp, struct mbuf *m)
lan91c11x_unlock();
/* Enable TX interrupts */
- lan91c11x_write_reg(LAN91C11X_INT,
+ lan91c11x_write_reg(LAN91C11X_INT,
(lan91c11x_read_reg(LAN91C11X_INT) |
LAN91C11X_INT_TXMASK |
LAN91C11X_INT_TXEMASK));
/* Enqueue it */
- lan91c11x_write_reg(LAN91C11X_MMUCMD,
+ lan91c11x_write_reg(LAN91C11X_MMUCMD,
LAN91C11X_MMUCMD_ENQUEUE);
-
+
/* free the mbuf chain we just copied */
m_freem(m);
-
+
} /* mc9328mxl_enet_sendpacket () */
@@ -525,7 +525,7 @@ void mc9328mxl_enet_rx_task(void *arg)
&events);
/* Configure for reads from RX data area */
- lan91c11x_write_reg(LAN91C11X_PTR,
+ lan91c11x_write_reg(LAN91C11X_PTR,
(LAN91C11X_PTR_AUTOINC |
LAN91C11X_PTR_RCV |
LAN91C11X_PTR_READ));
@@ -540,16 +540,16 @@ void mc9328mxl_enet_rx_task(void *arg)
/* get an mbuf for this packet */
MGETHDR(m, M_WAIT, MT_DATA);
-
+
/* now get a cluster pointed to by the mbuf */
/* since an mbuf by itself is too small */
MCLGET(m, M_WAIT);
lan91c11x_lock();
-
+
/* Copy the received packet into an mbuf */
for (i = 0; i < (pktlen / 2); i++) {
- ((uint16_t*)m->m_ext.ext_buf)[i] =
+ ((uint16_t*)m->m_ext.ext_buf)[i] =
lan91c11x_read_reg_fast(LAN91C11X_DATA);
}
@@ -561,23 +561,23 @@ void mc9328mxl_enet_rx_task(void *arg)
lan91c11x_unlock();
/* Release the packets memory */
- lan91c11x_write_reg(LAN91C11X_MMUCMD,
+ lan91c11x_write_reg(LAN91C11X_MMUCMD,
LAN91C11X_MMUCMD_REMTOP);
/* set the receiving interface */
m->m_pkthdr.rcvif = ifp;
m->m_nextpkt = 0;
-
+
/* set the length of the mbuf */
m->m_len = pktlen - (sizeof(struct ether_header));
m->m_pkthdr.len = m->m_len;
-
+
/* strip off the ethernet header from the mbuf */
/* but save the pointer to it */
eh = mtod (m, struct ether_header *);
m->m_data += sizeof(struct ether_header);
-
-
+
+
softc.stats.rx_packets++;
/* give all this stuff to the stack */
@@ -589,7 +589,7 @@ void mc9328mxl_enet_rx_task(void *arg)
lan91c11x_write_reg(LAN91C11X_INT, int_reg);
}
-} /* mc9328mxl_enet_rx_task */
+} /* mc9328mxl_enet_rx_task */
/* Show interface statistics */
@@ -609,7 +609,7 @@ static void enet_isr_on(const rtems_irq_connect_data *unused)
{
/* Enable interrupts */
MC9328MXL_AITC_INTENNUM = MC9328MXL_INT_GPIO_PORTA;
-
+
return;
}
@@ -636,38 +636,38 @@ mc9328mxl_enet_ioctl (struct ifnet *ifp, ioctl_command_t command, caddr_t data)
{
mc9328mxl_enet_softc_t *sc = ifp->if_softc;
int error = 0;
-
+
switch (command) {
case SIOCGIFADDR:
case SIOCSIFADDR:
ether_ioctl (ifp, command, data);
break;
-
+
case SIOCSIFFLAGS:
switch (ifp->if_flags & (IFF_UP | IFF_RUNNING))
{
case IFF_RUNNING:
mc9328mxl_enet_stop (sc);
break;
-
+
case IFF_UP:
mc9328mxl_enet_init (sc);
break;
-
+
case IFF_UP | IFF_RUNNING:
mc9328mxl_enet_stop (sc);
mc9328mxl_enet_init (sc);
break;
-
+
default:
break;
} /* switch (if_flags) */
break;
-
+
case SIO_RTEMS_SHOW_STATS:
mc9328mxl_enet_stats (sc);
break;
-
+
/*
* FIXME: All sorts of multicast commands need to be added here!
*/
@@ -686,14 +686,14 @@ static void enet_isr(rtems_irq_hdl_param unused)
softc.stats.interrupts++;
/* get the ISR status and determine RX or TX */
int_reg = lan91c11x_read_reg(LAN91C11X_INT);
-
+
/* Handle RX interrupts */
if ((int_reg & LAN91C11X_INT_RX) && (int_reg & LAN91C11X_INT_RXMASK)) {
softc.stats.rx_interrupts++;
/* Disable the interrupt */
int_reg &= ~LAN91C11X_INT_RXMASK;
-
+
rtems_event_send (softc.rx_task, START_RECEIVE_EVENT);
}
@@ -716,7 +716,7 @@ static void enet_isr(rtems_irq_hdl_param unused)
softc.stats.txerr_interrupts++;
printk("Caught TX interrupt - error on transmission\n");
}
-
+
/* Update the interrupt register on the 91c11x */
lan91c11x_write_reg(LAN91C11X_INT, int_reg);
diff --git a/c/src/lib/libbsp/arm/csb336/start/start.S b/c/src/lib/libbsp/arm/csb336/start/start.S
index 80bd30f80d..67c74b114a 100644
--- a/c/src/lib/libbsp/arm/csb336/start/start.S
+++ b/c/src/lib/libbsp/arm/csb336/start/start.S
@@ -2,7 +2,7 @@
* Cogent CSB336 startup code
*
* Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
- *
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
*
@@ -16,7 +16,7 @@
#warning The call is "void boot_card(const char* cmdline);"
#warning You need to pass a NULL.
#warning Please check and remove these warnings.
-
+
/* Some standard definitions...*/
.equ PSR_MODE_USR, 0x10
.equ PSR_MODE_FIQ, 0x11
@@ -33,25 +33,25 @@
.text
.globl _start
_start:
- /*
+ /*
* Since I don't plan to return to the bootloader,
* I don't have to save the registers.
*
- * I'll just set the CPSR for SVC mode, interrupts
+ * I'll just set the CPSR for SVC mode, interrupts
* off, and ARM instructions.
*/
mov r0, #(PSR_MODE_SVC | PSR_I | PSR_F)
msr cpsr, r0
-
+
/* zero the bss */
ldr r1, =_bss_end_
ldr r0, =_bss_start_
-_bss_init:
+_bss_init:
mov r2, #0
cmp r0, r1
strlot r2, [r0], #4
- blo _bss_init /* loop while r0 < r1 */
+ blo _bss_init /* loop while r0 < r1 */
/* --- Initialize stack pointer registers */
@@ -75,33 +75,33 @@ _bss_init:
ldr r1, =_abt_stack_size
ldr sp, =_abt_stack
add sp, sp, r1
-
+
/* Enter UNDEF mode and set up the UNDEF stack pointer */
mov r0, #(PSR_MODE_UNDEF | PSR_I | PSR_F) /* No interrupts */
msr cpsr, r0
ldr r1, =_undef_stack_size
ldr sp, =_undef_stack
add sp, sp, r1
-
+
/* Set up the SVC stack pointer last and stay in SVC mode */
mov r0, #(PSR_MODE_SVC | PSR_I | PSR_F) /* No interrupts */
msr cpsr, r0
ldr r1, =_svc_stack_size
ldr sp, =_svc_stack
add sp, sp, r1
- sub sp, sp, #0x64
+ sub sp, sp, #0x64
- /*
+ /*
* Initialize the MMU. After we return, the MMU is enabled,
* and memory may be remapped. I hope we don't remap this
* memory away.
*/
ldr r0, =mem_map
- bl mmu_init
+ bl mmu_init
- /*
+ /*
* Initialize the exception vectors. This includes the
- * exceptions vectors (0x00000000-0x0000001c), and the
+ * exceptions vectors (0x00000000-0x0000001c), and the
* pointers to the exception handlers (0x00000020-0x0000003c).
*/
mov r0, #0
@@ -114,7 +114,7 @@ _bss_init:
/* Now we are prepared to start the BSP's C code */
bl boot_card
- /*
+ /*
* Theoretically, we could return to what started us up,
* but we'd have to have saved the registers and stacks.
* Instead, we'll just reset.
@@ -124,13 +124,13 @@ _bss_init:
/* We shouldn't get here. If we do, hang */
_hang: b _hang
-
-/*
+
+/*
* This is the exception vector table and the pointers to
* the functions that handle the exceptions. It's a total
* of 16 words (64 bytes)
*/
-vector_block:
+vector_block:
ldr pc, Reset_Handler
ldr pc, Undefined_Handler
ldr pc, SWI_Handler
@@ -142,7 +142,7 @@ vector_block:
Reset_Handler: b bsp_reset
Undefined_Handler: b Undefined_Handler
-SWI_Handler: b SWI_Handler
+SWI_Handler: b SWI_Handler
Prefetch_Handler: b Prefetch_Handler
Abort_Handler: b Abort_Handler
nop
diff --git a/c/src/lib/libbsp/arm/csb337/console/fbcons.c b/c/src/lib/libbsp/arm/csb337/console/fbcons.c
index a0967d1932..54e309c52d 100644
--- a/c/src/lib/libbsp/arm/csb337/console/fbcons.c
+++ b/c/src/lib/libbsp/arm/csb337/console/fbcons.c
@@ -30,8 +30,8 @@ static void fbcons_write_polled(int minor, char c);
static int fbcons_set_attributes(int minor, const struct termios *t);
/* Pointers to functions for handling the UART. */
-console_fns fbcons_fns =
-{
+console_fns fbcons_fns =
+{
libchip_serial_default_probe,
fbcons_first_open,
fbcons_last_close,
@@ -46,24 +46,24 @@ console_fns fbcons_fns =
/* Functions called via callbacks (i.e. the ones in uart_fns */
/*********************************************************************/
-/*
+/*
* This is called the first time each device is opened. Since
- * the driver is polled, we don't have to do anything. If the driver
- * were interrupt driven, we'd enable interrupts here.
+ * the driver is polled, we don't have to do anything. If the driver
+ * were interrupt driven, we'd enable interrupts here.
*/
-static int fbcons_first_open(int major, int minor, void *arg)
+static int fbcons_first_open(int major, int minor, void *arg)
{
/* printk( "Frame buffer -- first open\n" ); */
return 0;
}
-/*
+/*
* This is called the last time each device is closed. Since
- * the driver is polled, we don't have to do anything. If the driver
- * were interrupt driven, we'd disable interrupts here.
+ * the driver is polled, we don't have to do anything. If the driver
+ * were interrupt driven, we'd disable interrupts here.
*/
-static int fbcons_last_close(int major, int minor, void *arg)
+static int fbcons_last_close(int major, int minor, void *arg)
{
/* printk( "Frame buffer -- last close\n" ); */
return 0;
@@ -76,15 +76,15 @@ static int fbcons_last_close(int major, int minor, void *arg)
* return -1 if there's no data, otherwise return
* the character in lowest 8 bits of returned int.
*/
-static int fbcons_read(int minor)
+static int fbcons_read(int minor)
{
/* printk( "Frame buffer -- read\n" ); */
return -1;
}
-/*
- * Write buffer to LCD
+/*
+ * Write buffer to LCD
*
* return 1 on success, -1 on error
*/
@@ -115,7 +115,7 @@ static void fbcons_write_polled(int minor, char c)
}
/* This is for setting baud rate, bits, etc. */
-static int fbcons_set_attributes(int minor, const struct termios *t)
+static int fbcons_set_attributes(int minor, const struct termios *t)
{
/* printk( "frame buffer -- set attributes\n" ); */
return 0;
@@ -127,7 +127,7 @@ static int fbcons_set_attributes(int minor, const struct termios *t)
* functions use them instead.
*/
/***********************************************************************/
-/*
+/*
* Read from UART. This is used in the exit code, and can't
* rely on interrupts.
*/
diff --git a/c/src/lib/libbsp/arm/csb337/console/font8x16.h b/c/src/lib/libbsp/arm/csb337/console/font8x16.h
index 2dac5e66c3..87cb5b74ac 100755
--- a/c/src/lib/libbsp/arm/csb337/console/font8x16.h
+++ b/c/src/lib/libbsp/arm/csb337/console/font8x16.h
@@ -1,7 +1,7 @@
/*
* font8x16.h
*
- * Simple 8 x 16 font printable characters only. To lookoup, subtract
+ * Simple 8 x 16 font printable characters only. To lookoup, subtract
* FIRST_CHAR from the character, multiply x FONT_HEIGHT and get the next
* FONT_WIDTH bytes.
*
@@ -38,7 +38,7 @@
#define FONT_WIDTH 8
#define FONT_HEIGHT 16
#define FIRST_CHAR 0x20
-#define LAST_CHAR 0x7f
+#define LAST_CHAR 0x7f
#define CURSOR_ON 0x7F
#define CURSOR_OFF 0x20
diff --git a/c/src/lib/libbsp/arm/csb337/console/sed1356.c b/c/src/lib/libbsp/arm/csb337/console/sed1356.c
index 84971cf0ef..7e81ff4b4a 100644
--- a/c/src/lib/libbsp/arm/csb337/console/sed1356.c
+++ b/c/src/lib/libbsp/arm/csb337/console/sed1356.c
@@ -83,7 +83,7 @@ void sed_scroll(void);
#define SED1356_REG_LCD_DISP_START_LO_and_MID SED_REG16(0x42)
#define SED1356_REG_LCD_DISP_START_HI SED_REG16(0x44)
#define SED1356_REG_LCD_ADD_OFFSET_LO_and_HI SED_REG16(0x46)
-#define SED1356_REG_LCD_PIXEL_PAN SED_REG16(0x48)
+#define SED1356_REG_LCD_PIXEL_PAN SED_REG16(0x48)
#define SED1356_REG_LCD_FIFO_THRESH_LO_and_HI SED_REG16(0x4a)
#endif
@@ -242,7 +242,7 @@ void sed_putchar(char c)
sed_scroll();
}
break;
- }
+ }
} /* sed_putchar() */
@@ -259,7 +259,7 @@ void sed_writechar(uint8_t c)
uint8_t font_data8;
uint16_t wr16;
- /* Convert the current row,col and color depth values
+ /* Convert the current row,col and color depth values
* into an address
*/
sed_mem_add = SED_GET_ADD(sed_row, sed_col, sed_color_depth);
@@ -277,8 +277,8 @@ void sed_writechar(uint8_t c)
for (font_row = 0; font_row < FONT_HEIGHT; font_row++) {
/* get the font row of data */
font_data8 = font8x16[(c * FONT_HEIGHT) + font_row];
-
-
+
+
for (font_col = 0; font_col < 8; font_col += 4)
{
/* get a words worth of pixels */
@@ -363,7 +363,7 @@ void sed_update_fb_offset(void)
{
/* write the new sed_fb_offset value */
if (sed_disp_mode_crt) {
- /* before we change the address offset, wait for the display to
+ /* before we change the address offset, wait for the display to
* go from active to non-active, unless the display is not enabled
*/
if (SED1356_REG_DISP_MODE & H2SED(SED1356_DISP_MODE_CRT)) { /* CRT is on */
@@ -453,7 +453,7 @@ void sed_clearscreen(void)
/* 16-bits bypasses the lookup table */
default: wr16 = vga_lookup[bg]; break;
}
- for (i = 0; i < fbsize; i += 2){
+ for (i = 0; i < fbsize; i += 2){
sed_write_frame_buffer(i, wr16);
}
}
diff --git a/c/src/lib/libbsp/arm/csb337/console/sed1356_16bit.h b/c/src/lib/libbsp/arm/csb337/console/sed1356_16bit.h
index 241060a4d7..3326480f44 100755
--- a/c/src/lib/libbsp/arm/csb337/console/sed1356_16bit.h
+++ b/c/src/lib/libbsp/arm/csb337/console/sed1356_16bit.h
@@ -37,9 +37,9 @@
#include "bits.h"
/*------------------------------------------------------------------------
* cpu specific code must define the following board specific macros.
- * in cpuio.h. These examples assume the SED135x has been placed in
+ * in cpuio.h. These examples assume the SED135x has been placed in
* the correct endian mode via hardware.
- * #define SED_MEM_BASE 0xf0600000 <-- just example addresses,
+ * #define SED_MEM_BASE 0xf0600000 <-- just example addresses,
* #define SED_REG_BASE 0xf0400000 <-- define for each board
* #define SED_STEP 1 <-- 1 = device is on 16-bit boundry, 2 = 32-bit boundry, 4 = 64-bit boundry
* #define SED_REG16(_x_) *(vushortr *)(SED_REG_BASE + (_x_ * SED_STEP)) // Control/Status Registers
@@ -80,7 +80,7 @@
#define SED1356_REG_LCD_DISP_START_LO_and_MID SED_REG16(0x42)
#define SED1356_REG_LCD_DISP_START_HI SED_REG16(0x44)
#define SED1356_REG_LCD_ADD_OFFSET_LO_and_HI SED_REG16(0x46)
-#define SED1356_REG_LCD_PIXEL_PAN SED_REG16(0x48)
+#define SED1356_REG_LCD_PIXEL_PAN SED_REG16(0x48)
#define SED1356_REG_LCD_FIFO_THRESH_LO_and_HI SED_REG16(0x4a)
/* CRT/TV Control registers */
#define SED1356_REG_CRT_HOR_DISP SED_REG16(0x50)
@@ -100,7 +100,7 @@
#define SED1356_REG_LCD_CURSOR_X_POS_LO_and_HI SED_REG16(0x72)
#define SED1356_REG_LCD_CURSOR_Y_POS_LO_and_HI SED_REG16(0x74)
#define SED1356_REG_LCD_CURSOR_BLUE_and_GREEN_CLR_0 SED_REG16(0x76)
-#define SED1356_REG_LCD_CURSOR_RED_CLR_0 SED_REG16(0x78)
+#define SED1356_REG_LCD_CURSOR_RED_CLR_0 SED_REG16(0x78)
#define SED1356_REG_LCD_CURSOR_BLUE_and_GREEN_CLR_1 SED_REG16(0x7a)
#define SED1356_REG_LCD_CURSOR_RED_CLR_1 SED_REG16(0x7c)
#define SED1356_REG_LCD_CURSOR_FIFO_THRESH SED_REG16(0x7e)
@@ -152,8 +152,8 @@
#define SED1356_GPIO_GPIO1 BIT1
/* SED1356_REG_MCLK_CFG */
-#define SED1356_MCLK_DIV2 BIT4
-#define SED1356_MCLK_SRC_BCLK BIT0
+#define SED1356_MCLK_DIV2 BIT4
+#define SED1356_MCLK_SRC_BCLK BIT0
#define SED1356_MCLK_SRC_CLKI 0x00
/* SED1356_REG_LCD_PCLK_CFG, SED1356_REG_CRT_PCLK_CFG
@@ -170,11 +170,11 @@
#define SED1356_PCLK_SRC_MCLK 0x03
/* SED1356_REG_MEM_CFG_and_REF_RATE - even */
-#define SED1356_MEM_CFG_2CAS_EDO 0x00
-#define SED1356_MEM_CFG_2CAS_FPM 0x01
-#define SED1356_MEM_CFG_2WE_EDO 0x02
-#define SED1356_MEM_CFG_2WE_FPM 0x03
-#define SED1356_MEM_CFG_MASK 0x03
+#define SED1356_MEM_CFG_2CAS_EDO 0x00
+#define SED1356_MEM_CFG_2CAS_FPM 0x01
+#define SED1356_MEM_CFG_2WE_EDO 0x02
+#define SED1356_MEM_CFG_2WE_FPM 0x03
+#define SED1356_MEM_CFG_MASK 0x03
/* SED1356_REG_MEM_CFG_and_REF_RATE - odd */
#define SED1356_REF_TYPE_CBR 0x00 << 6 << 8
@@ -236,7 +236,7 @@
#define SED1356_MEM_TMG1_FPM80_MCLK20 0x01 << 8
-/* Bit definitions
+/* Bit definitions
*
* SED1356_REG_PANEL_TYPE_AND_MOD_RATE - even
*/
@@ -425,87 +425,87 @@ LU_BRT_WHITE /* 15 */
/* Vertical and Horizontal Pulse, Start and Non-Display values vary depending
* upon the mode. The following section gives some insight into how the
* values are arrived at.
- * ms = milliseconds, us = microseconds, ns = nanoseconds
- * Mhz = Megaherz, Khz = Kiloherz, Hz = Herz
+ * ms = milliseconds, us = microseconds, ns = nanoseconds
+ * Mhz = Megaherz, Khz = Kiloherz, Hz = Herz
*
- * ***************************************************************************************************
+ * ***************************************************************************************************
* CRT Mode is 640x480 @ 72Hz VESA compatible timing. PCLK = 31.5Mhz (31.75ns)
- * ***************************************************************************************************
+ * ***************************************************************************************************
*
- * CRT MODE HORIZONTAL TIMING PARAMETERS
+ * CRT MODE HORIZONTAL TIMING PARAMETERS
*
- * |<-------Tha------->|
- * |___________________| ______
- * Display Enable _____________________| |____________________|
- * | |
- * Horizontal Pulse __ ________|___________________|________ __________
- * |_________| | | |________|
- * |<- Thp ->| | | |
- * | |<-Thbp->| | |
- * | |<-Thfp->|
- * |<----------------------Tht-------------------->|
+ * |<-------Tha------->|
+ * |___________________| ______
+ * Display Enable _____________________| |____________________|
+ * | |
+ * Horizontal Pulse __ ________|___________________|________ __________
+ * |_________| | | |________|
+ * |<- Thp ->| | | |
+ * | |<-Thbp->| | |
+ * | |<-Thfp->|
+ * |<----------------------Tht-------------------->|
*
- * Tha - Active Display Time = 640 pixels
- * Thp - Horizontal Pulse = 1.27us/31.75ns = 40 pixels
- * Thbp - Horizontal Front Porch = 1.016us/31.75ns = 32 pixels
- * Thfp - Horizontal Back Porch = 3.8us/31.75ns = 120 pixels
- * Tht - Total Horizontal Time = 832 pixels x 32.75ns/pixel = 26.416us or 38.785Khz
+ * Tha - Active Display Time = 640 pixels
+ * Thp - Horizontal Pulse = 1.27us/31.75ns = 40 pixels
+ * Thbp - Horizontal Front Porch = 1.016us/31.75ns = 32 pixels
+ * Thfp - Horizontal Back Porch = 3.8us/31.75ns = 120 pixels
+ * Tht - Total Horizontal Time = 832 pixels x 32.75ns/pixel = 26.416us or 38.785Khz
*
- * Correlation between horizontal timing parameters and SED registers
+ * Correlation between horizontal timing parameters and SED registers
*/
#define SED_HOR_PULSE_WIDTH_CRT 0x07 /* Horizontal Pulse Width Register = (Thp/8) - 1 */
#define SED_HOR_PULSE_START_CRT 0x02 /* Horizontal Pulse Start Position Register = ((Thfp + 2)/8) - 1 */
#define SED_HOR_NONDISP_CRT 0x17 /* Horizontal Non-Display Period Register = ((Thp + Thfp + Thbp)/8) - 1 */
/*
- * CRT MODE VERTICAL TIMING PARAMTERS
+ * CRT MODE VERTICAL TIMING PARAMTERS
*
- * |<-------Tva------->|
- * |___________________| ______
- * Display Enable _____________________| |_____________________|
- * | |
- * Vertical Pulse __ ________|___________________|________ __________
- * |_________| | | |________|
- * |<- Tvp ->| | | |
- * | |<-Tvbp->| | |
- * | |<-Tvfp->|
- * |<----------------------Tvt-------------------->|
+ * |<-------Tva------->|
+ * |___________________| ______
+ * Display Enable _____________________| |_____________________|
+ * | |
+ * Vertical Pulse __ ________|___________________|________ __________
+ * |_________| | | |________|
+ * |<- Tvp ->| | | |
+ * | |<-Tvbp->| | |
+ * | |<-Tvfp->|
+ * |<----------------------Tvt-------------------->|
*
- * Tva - Active Display Time = 480 lines
- * Tvp - Vertical Pulse = 3 lines
- * Tvfp - Vertical Front Porch = 9 lines
- * Tvbp - Vertical Back Porch = 28 lines
- * Tvt - Total Horizontal Time = 520 lines x 26.416us/line = 13.73632ms or 72.8Hz
+ * Tva - Active Display Time = 480 lines
+ * Tvp - Vertical Pulse = 3 lines
+ * Tvfp - Vertical Front Porch = 9 lines
+ * Tvbp - Vertical Back Porch = 28 lines
+ * Tvt - Total Horizontal Time = 520 lines x 26.416us/line = 13.73632ms or 72.8Hz
*
- * Correlation between vertical timing parameters and SED registers
+ * Correlation between vertical timing parameters and SED registers
*/
#define SED_VER_PULSE_WIDTH_CRT 0x02 // VRTC/FPFRAME Pulse Width Register = Tvp - 1
-#define SED_VER_PULSE_START_CRT 0x08 // VRTC/FPFRAME Start Position Register = Tvfp - 1
+#define SED_VER_PULSE_START_CRT 0x08 // VRTC/FPFRAME Start Position Register = Tvfp - 1
#define SED_VER_NONDISP_CRT 0x27 // Vertical Non-Display Period Register = (Tvp + Tvfp + Tvbp) - 1
/*
- *****************************************************************************************************
+ *****************************************************************************************************
* DUAL LCD Mode is 640x480 @ 60Hz VGA compatible timing. PCLK = 25.175Mhz (39.722ns)
- *****************************************************************************************************
+ *****************************************************************************************************
*
- * LCD MODE HORIZONTAL TIMING PARAMTERS
+ * LCD MODE HORIZONTAL TIMING PARAMTERS
*
- * |<-------Tha------->|
- * |___________________| ______
- * Display Enable _____________________| |____________________|
- * | |
- * Horizontal Pulse __ ________|___________________|________ __________
- * |_________| | | |________|
- * |<- Thp ->| | | |
- * | |<-Thbp->| | |
- * | |<-Thfp->|
- * |<----------------------Tht-------------------->|
+ * |<-------Tha------->|
+ * |___________________| ______
+ * Display Enable _____________________| |____________________|
+ * | |
+ * Horizontal Pulse __ ________|___________________|________ __________
+ * |_________| | | |________|
+ * |<- Thp ->| | | |
+ * | |<-Thbp->| | |
+ * | |<-Thfp->|
+ * |<----------------------Tht-------------------->|
*
- * Tha - Active Display Time = 640 pixels
- * Thp - Horizontal Pulse = 3.8us/39.72ns = 96 pixels
- * Thfp - Horizontal Front Porch = .595us/39.72ns = 16 pixels
- * Thbp - Horizontal Backporch = 1.9us/39.72ns = 48 pixels
- * Tht - Total Horizontal Time = = 800 pixels @ 39.72ns/pixel = 31.776us or 31.47Khz
+ * Tha - Active Display Time = 640 pixels
+ * Thp - Horizontal Pulse = 3.8us/39.72ns = 96 pixels
+ * Thfp - Horizontal Front Porch = .595us/39.72ns = 16 pixels
+ * Thbp - Horizontal Backporch = 1.9us/39.72ns = 48 pixels
+ * Tht - Total Horizontal Time = = 800 pixels @ 39.72ns/pixel = 31.776us or 31.47Khz
*
- * Correlation between horizontal timing parameters and SED registers
+ * Correlation between horizontal timing parameters and SED registers
*#define SED_HOR_PULSE_WIDTH_LCD 0x0b // HRTC/FPLINE Pulse Width Register = (Thp/8) - 1
*#define SED_HOR_PULSE_START_LCD 0x02 // HRTC/FPLINE Start Position Register = (Thfp/8) - 2
*#define SED_HOR_NONDISP_LCD 0x13 // Horizontal Non-Display Period Register = ((Thp + Thfp + Thbp)/8) - 1
@@ -516,28 +516,28 @@ extern long SED_HOR_NONDISP_LCD;
/*
*
- * LCD MODE VERTICAL TIMING PARAMTERS
+ * LCD MODE VERTICAL TIMING PARAMTERS
*
- * |<-------Tva------->|
- * |___________________| ______
- * Display Enable _____________________| |_____________________|
- * | |
- * Vertical Pulse __ ________|___________________|________ __________
- * |_________| | | |________|
- * |<- Tvp ->| | | |
- * | |<-Tvbp->| | |
- * | |<-Tvfp->|
- * |<----------------------Tvt-------------------->|
+ * |<-------Tva------->|
+ * |___________________| ______
+ * Display Enable _____________________| |_____________________|
+ * | |
+ * Vertical Pulse __ ________|___________________|________ __________
+ * |_________| | | |________|
+ * |<- Tvp ->| | | |
+ * | |<-Tvbp->| | |
+ * | |<-Tvfp->|
+ * |<----------------------Tvt-------------------->|
*
- * Tva - Active Display Time = 480 lines
- * Tvp - Vertical Pulse = 2 lines
- * Tvfp - Vertical Front Porch = 10 lines
- * Tvbp - Vertical Backporch = 33 lines
- * Tvt - Total Horizontal Time = 525 lines @ 31.776us/line = 16.682ms or 60Hz
+ * Tva - Active Display Time = 480 lines
+ * Tvp - Vertical Pulse = 2 lines
+ * Tvfp - Vertical Front Porch = 10 lines
+ * Tvbp - Vertical Backporch = 33 lines
+ * Tvt - Total Horizontal Time = 525 lines @ 31.776us/line = 16.682ms or 60Hz
*
- * Correlation between vertical timing parameters and SED registers
+ * Correlation between vertical timing parameters and SED registers
*#define SED_VER_PULSE_WIDTH_LCD 0x01 // VRTC/FPFRAME Pulse Width Register = Tvp - 1
- *#define SED_VER_PULSE_START_LCD 0x09 // VRTC/FPFRAME Start Position Register = Tvfp - 1
+ *#define SED_VER_PULSE_START_LCD 0x09 // VRTC/FPFRAME Start Position Register = Tvfp - 1
*#define SED_VER_NONDISP_LCD 0x2c // Vertical Non-Display Period Register = (Tvp + Tvfp + Tvbp) - 1
*/
extern long SED_VER_PULSE_WIDTH_LCD;
diff --git a/c/src/lib/libbsp/arm/csb337/console/uarts.c b/c/src/lib/libbsp/arm/csb337/console/uarts.c
index c5e8288379..7b9ab8002c 100644
--- a/c/src/lib/libbsp/arm/csb337/console/uarts.c
+++ b/c/src/lib/libbsp/arm/csb337/console/uarts.c
@@ -1,11 +1,11 @@
/*
* Console driver for for KIT637_V6 (CSB637)
*
- * This driver uses the shared console driver in
+ * This driver uses the shared console driver in
* ...../libbsp/shared/console.c
*
* Copyright (c) 2003 by Cogent Computer Systems
- * Written by Jay Monkman <jtm@lopingdog.com>
+ * Written by Jay Monkman <jtm@lopingdog.com>
*
* Modified by Fernando Nicodemos <fgnicodemos@terra.com.br>
* from NCB - Sistemas Embarcados Ltda. (Brazil)
@@ -14,7 +14,7 @@
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
- * Modified and FrameBuffer Console Device Support added by
+ * Modified and FrameBuffer Console Device Support added by
* Joel Sherrill, 2009.
*
* $Id$
@@ -46,35 +46,35 @@ extern console_fns dbgu_fns;
extern console_fns umoncons_fns;
#define UMON_CONS_DEV 1
#else
- #define UMON_CONS_DEV 0
+ #define UMON_CONS_DEV 0
#endif
#if ENABLE_USART0 || ENABLE_USART1 || ENABLE_USART2 || ENABLE_USART3
extern console_fns usart_polling_fns;
#endif
-#if ENABLE_USART0
+#if ENABLE_USART0
#define USART0_DEV 1
#else
- #define USART0_DEV 0
+ #define USART0_DEV 0
#endif
-#if ENABLE_USART1
+#if ENABLE_USART1
#define USART1_DEV 1
#else
- #define USART1_DEV 0
+ #define USART1_DEV 0
#endif
#if ENABLE_USART2
#define USART2_DEV 1
#else
- #define USART2_DEV 0
+ #define USART2_DEV 0
#endif
#if ENABLE_USART3
#define USART3_DEV 1
#else
- #define USART3_DEV 0
+ #define USART3_DEV 0
#endif
#define NUM_DEVS \
@@ -85,7 +85,7 @@ extern console_fns dbgu_fns;
unsigned long Console_Port_Count = NUM_DEVS;
console_data Console_Port_Data[NUM_DEVS];
-/*
+/*
* There's one item in array for each UART.
*
* Some of these fields are marked "NOT USED". They are not used
diff --git a/c/src/lib/libbsp/arm/csb337/include/bsp.h b/c/src/lib/libbsp/arm/csb337/include/bsp.h
index 1e5a8cc88f..72e2883a10 100644
--- a/c/src/lib/libbsp/arm/csb337/include/bsp.h
+++ b/c/src/lib/libbsp/arm/csb337/include/bsp.h
@@ -38,7 +38,7 @@ console_tbl *BSP_get_uart_from_minor(int minor);
static inline int32_t BSP_get_baud(void) {return 38400;}
#define ST_PIMR_PIV 33 /* 33 ticks of the 32.768Khz clock ~= 1msec */
-
+
/*
* Network driver configuration
*/
diff --git a/c/src/lib/libbsp/arm/csb337/network/network.c b/c/src/lib/libbsp/arm/csb337/network/network.c
index 5960476241..34f8a7b5bc 100644
--- a/c/src/lib/libbsp/arm/csb337/network/network.c
+++ b/c/src/lib/libbsp/arm/csb337/network/network.c
@@ -523,8 +523,8 @@ void at91rm9200_emac_init_hw(at91rm9200_emac_softc_t *sc)
#if defined(PHY_DBG)
printk("10MBIT, ");
#endif
- }
-
+ }
+
if (emac_link_status & (PHY_STAT_100BASE_X_FDX | PHY_STAT_10BASE_FDX)) {
EMAC_REG(EMAC_CFG) |= EMAC_CFG_FD;
#if defined(PHY_DBG)
@@ -535,7 +535,7 @@ void at91rm9200_emac_init_hw(at91rm9200_emac_softc_t *sc)
#if defined(PHY_DBG)
printk("Half Duplex.\n");
#endif
- }
+ }
/* Set PHY LED modes. Traffic Meter Mode for ACTLED
* Set Bit 6 - Traffic Mode on
diff --git a/c/src/lib/libbsp/arm/csb337/start/start.S b/c/src/lib/libbsp/arm/csb337/start/start.S
index f44fd22466..f3b2131a02 100644
--- a/c/src/lib/libbsp/arm/csb337/start/start.S
+++ b/c/src/lib/libbsp/arm/csb337/start/start.S
@@ -2,7 +2,7 @@
* Cogent CSB337 startup code
*
* Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
- *
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
*
@@ -28,25 +28,25 @@
.text
.globl _start
_start:
- /*
+ /*
* Since I don't plan to return to the bootloader,
* I don't have to save the registers.
*
- * I'll just set the CPSR for SVC mode, interrupts
+ * I'll just set the CPSR for SVC mode, interrupts
* off, and ARM instructions.
*/
mov r0, #(PSR_MODE_SVC | PSR_I | PSR_F)
msr cpsr, r0
-
+
/* zero the bss */
ldr r1, =_bss_end_
ldr r0, =_bss_start_
-_bss_init:
+_bss_init:
mov r2, #0
cmp r0, r1
strlot r2, [r0], #4
- blo _bss_init /* loop while r0 < r1 */
+ blo _bss_init /* loop while r0 < r1 */
/* --- Initialize stack pointer registers */
@@ -70,26 +70,26 @@ _bss_init:
ldr r1, =_abt_stack_size
ldr sp, =_abt_stack
add sp, sp, r1
-
+
/* Set up the SVC stack pointer last and stay in SVC mode */
mov r0, #(PSR_MODE_SVC | PSR_I | PSR_F) /* No interrupts */
msr cpsr, r0
ldr r1, =_svc_stack_size
ldr sp, =_svc_stack
add sp, sp, r1
- sub sp, sp, #0x64
+ sub sp, sp, #0x64
- /*
+ /*
* Initialize the MMU. After we return, the MMU is enabled,
* and memory may be remapped. I hope we don't remap this
* memory away.
*/
ldr r0, =mem_map
- bl mmu_init
+ bl mmu_init
- /*
+ /*
* Initialize the exception vectors. This includes the
- * exceptions vectors (0x00000000-0x0000001c), and the
+ * exceptions vectors (0x00000000-0x0000001c), and the
* pointers to the exception handlers (0x00000020-0x0000003c).
*/
mov r0, #0
@@ -103,7 +103,7 @@ _bss_init:
mov r0, #0
bl boot_card
- /*
+ /*
* Theoretically, we could return to what started us up,
* but we'd have to have saved the registers and stacks.
* Instead, we'll just reset.
@@ -113,13 +113,13 @@ _bss_init:
/* We shouldn't get here. If we do, hang */
_hang: b _hang
-
-/*
+
+/*
* This is the exception vector table and the pointers to
* the functions that handle the exceptions. It's a total
* of 16 words (64 bytes)
*/
-vector_block:
+vector_block:
ldr pc, Reset_Handler
ldr pc, Undefined_Handler
ldr pc, SWI_Handler
@@ -131,7 +131,7 @@ vector_block:
Reset_Handler: b bsp_reset
Undefined_Handler: b Undefined_Handler
-SWI_Handler: b SWI_Handler
+SWI_Handler: b SWI_Handler
Prefetch_Handler: b Prefetch_Handler
Abort_Handler: b Abort_Handler
nop
diff --git a/c/src/lib/libbsp/arm/csb337/startup/bspreset.c b/c/src/lib/libbsp/arm/csb337/startup/bspreset.c
index 8a47d077db..3b0bbb6ea5 100644
--- a/c/src/lib/libbsp/arm/csb337/startup/bspreset.c
+++ b/c/src/lib/libbsp/arm/csb337/startup/bspreset.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2004 by Cogent Computer Systems
* Written by Jay Monkman <jtm@lopingdog.com>
- *
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
diff --git a/c/src/lib/libbsp/arm/csb337/startup/bspstart.c b/c/src/lib/libbsp/arm/csb337/startup/bspstart.c
index 9ffe729611..7566e32e85 100644
--- a/c/src/lib/libbsp/arm/csb337/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/csb337/startup/bspstart.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2004 by Cogent Computer Systems
* Written by Jay Monkman <jtm@lopingdog.com>
- *
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
*
@@ -38,7 +38,7 @@ void bsp_start_default( void )
/* disable interrupts */
AIC_CTL_REG(AIC_IDCR) = 0xffffffff;
- /*
+ /*
* Some versions of the bootloader have the MAC address
* reversed. This fixes it, if necessary.
*/
@@ -48,15 +48,15 @@ void bsp_start_default( void )
* Init rtems exceptions management
*/
rtems_exception_init_mngt();
-
+
/*
* Init rtems interrupt management
*/
rtems_irq_mngt_init();
-
+
} /* bsp_start */
-/*
+/*
* Some versions of the bootloader shipped with the CSB337
* reverse the MAC address. This function tests for that,
* and fixes the MAC address.
diff --git a/c/src/lib/libbsp/arm/edb7312/irq/irq.h b/c/src/lib/libbsp/arm/edb7312/irq/irq.h
index fcaf78f7a8..c96479e8d2 100644
--- a/c/src/lib/libbsp/arm/edb7312/irq/irq.h
+++ b/c/src/lib/libbsp/arm/edb7312/irq/irq.h
@@ -60,11 +60,11 @@ typedef unsigned int rtems_irq_number;
#define BSP_KBDINT 16
#define BSP_SS2RX 17
#define BSP_SS2TX 18
-#define BSP_UTXINT2 19
-#define BSP_URXINT2 20
+#define BSP_UTXINT2 19
+#define BSP_URXINT2 20
/* int interrupt status/mask register 3 */
#define BSP_DAIINT 21
-#define BSP_MAX_INT 22
+#define BSP_MAX_INT 22
/*
* Type definition for RTEMS managed interrupts
diff --git a/c/src/lib/libbsp/arm/edb7312/start/start.S b/c/src/lib/libbsp/arm/edb7312/start/start.S
index 8a9c840ef8..7abb50cd70 100644
--- a/c/src/lib/libbsp/arm/edb7312/start/start.S
+++ b/c/src/lib/libbsp/arm/edb7312/start/start.S
@@ -18,7 +18,7 @@
#warning The call is "void boot_card(const char* cmdline);"
#warning You need to pass a NULL.
#warning Please check and remove these warnings.
-
+
/* Some standard definitions...*/
.equ Mode_USR, 0x10
diff --git a/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c b/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c
index b47fbbbdd4..73841bdca1 100644
--- a/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c
+++ b/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c
@@ -33,7 +33,7 @@ void BSP_rtems_irq_mngt_init(void)
int i;
vectorTable = (long *) VECTOR_TABLE;
-
+
/* Initialize the vector table contents with default handler */
for (i=0; i<BSP_MAX_INT; i++) {
*(vectorTable + i) = (long)(default_int_handler);
diff --git a/c/src/lib/libbsp/arm/gba/start/start.S b/c/src/lib/libbsp/arm/gba/start/start.S
index 2566a246fe..33a7a823e6 100644
--- a/c/src/lib/libbsp/arm/gba/start/start.S
+++ b/c/src/lib/libbsp/arm/gba/start/start.S
@@ -54,7 +54,7 @@
#warning The call is "void boot_card(const char* cmdline);"
#warning You need to pass a NULL.
#warning Please check and remove these warnings.
-
+
#define __asm__
#include <rtems/asm.h>
#include <asm_macros.h>
diff --git a/c/src/lib/libbsp/arm/gdbarmsim/start/start.S b/c/src/lib/libbsp/arm/gdbarmsim/start/start.S
index dc443beb92..e7c820352e 100644
--- a/c/src/lib/libbsp/arm/gdbarmsim/start/start.S
+++ b/c/src/lib/libbsp/arm/gdbarmsim/start/start.S
@@ -80,7 +80,7 @@
- Allow linker script to provide stack via __stack symbol - see
defintion of .Lstack
- Provide "hooks" that may be used by the application to add
- custom init code - see .Lhwinit and .Lswinit
+ custom init code - see .Lhwinit and .Lswinit
- Go through all execution modes and set up stack for each of them.
Loosely based on init.s from ARM/Motorola example code.
Note: Mode switch via CPSR is not allowed once in non-privileged
@@ -91,10 +91,10 @@
cmp r3, #0
#ifdef __thumb2__
it eq
-#endif
+#endif
ldreq r3, .LC0
/* Note: This 'mov' is essential when starting in User, and ensures we
- always get *some* sp value for the initial mode, even if we
+ always get *some* sp value for the initial mode, even if we
have somehow missed it below (in which case it gets the same
value as FIQ - not ideal, but better than nothing.) */
mov sp, r3
@@ -107,8 +107,8 @@
msr CPSR_c, #0xD1 /* FIRQ mode, interrupts disabled */
mov sp, r3
sub sl, sp, #0x1000 /* This mode also has its own sl (see below) */
-
- mov r3, sl
+
+ mov r3, sl
msr CPSR_c, #0xD7 /* Abort mode, interrupts disabled */
mov sp, r3
sub r3, r3, #0x1000
@@ -120,7 +120,7 @@
msr CPSR_c, #0xD2 /* IRQ mode, interrupts disabled */
mov sp, r3
sub r3, r3, #0x2000
-
+
msr CPSR_c, #0xD3 /* Supervisory mode, interrupts disabled */
mov sp, r3
@@ -128,11 +128,11 @@
bic r3, r3, #0x00FF /* Align with current 64k block */
bic r3, r3, #0xFF00
- str r3, [r3, #-4] /* Move value into user mode sp without */
- ldmdb r3, {sp}^ /* changing modes, via '^' form of ldm */
+ str r3, [r3, #-4] /* Move value into user mode sp without */
+ ldmdb r3, {sp}^ /* changing modes, via '^' form of ldm */
orr r2, r2, #0xC0 /* Back to original mode, presumably SVC, */
msr CPSR_c, r2 /* with FIQ/IRQ disable bits forced to 1 */
-#endif
+#endif
.LC23:
/* Setup a default stack-limit in-case the code has been
compiled with "-mapcs-stack-check". Hard-wiring this value
@@ -148,11 +148,11 @@
mov a2, #0 /* Second arg: fill value */
mov fp, a2 /* Null frame pointer */
mov r7, a2 /* Null frame pointer for Thumb */
-
+
ldr a1, .LC1 /* First arg: start of memory block */
- ldr a3, .LC2
+ ldr a3, .LC2
sub a3, a3, a1 /* Third arg: length of block */
-
+
#if defined(__thumb__) && !defined(__thumb2__)
/* Enter Thumb mode.... */
@@ -162,9 +162,9 @@
.code 16
.global __change_mode
.thumb_func
-__change_mode:
+__change_mode:
#endif
-
+
bl FUNCTION (memset)
#if !defined (ARM_RDP_MONITOR) && !defined (ARM_RDI_MONITOR)
/* Changes by toralf: Taken from libgloss/m68k/crt0.S
@@ -180,7 +180,7 @@ __change_mode:
mov lr, pc
mov pc, r3
#endif
-.LC24:
+.LC24:
ldr r3, .Lswinit
cmp r3, #0
beq .LC25
@@ -191,13 +191,13 @@ __change_mode:
mov pc, r3
#endif
-.LC25:
+.LC25:
mov r0, #0 /* no arguments */
mov r1, #0 /* no argv either */
#else
/* Need to set up standard file handles */
bl FUNCTION (initialise_monitor_handles)
-
+
#ifdef ARM_RDP_MONITOR
swi SWI_GetEnv /* sets r0 to point to the command line */
mov r1, r0
@@ -289,7 +289,7 @@ __change_mode:
str r4, [r3]
add r3, #4
b .LC15
-.LC14:
+.LC14:
/* Ensure doubleword stack alignment. */
mov r4, sp
mov r5, #7
@@ -328,10 +328,10 @@ change_back:
With an Angel debug monitor, this will report 'Unknown SWI'. */
swi SWI_Exit
#endif
-
- /* For Thumb, constants must be after the code since only
+
+ /* For Thumb, constants must be after the code since only
positive offsets are supported for PC relative addresses. */
-
+
.align 0
.LC0:
#ifdef ARM_RDI_MONITOR
@@ -342,15 +342,15 @@ change_back:
may be defined externally; .Lstack will be used instead of .LC0 if
it points to a non-0 value. Also set up references to "hooks" that
may be used by the application to provide additional init code. */
-
+
#ifdef __pe__
.word 0x800000
#else
.word 0x80000 /* Top of RAM on the PIE board. */
#endif
-.Lstack:
+.Lstack:
.word __stack
-.Lhwinit:
+.Lhwinit:
.word FUNCTION (hardware_init_hook)
.Lswinit:
.word FUNCTION (software_init_hook)
@@ -360,13 +360,13 @@ change_back:
runtime (meaning "ignore setting") for the variables, when the user
does not provide the symbols. (The linker uses a weak symbol if,
and only if, a normal version of the same symbol isn't provided
- e.g. by a linker script or another object file.) */
+ e.g. by a linker script or another object file.) */
.weak __stack
- .weak FUNCTION (hardware_init_hook)
+ .weak FUNCTION (hardware_init_hook)
.weak FUNCTION (software_init_hook)
#endif
-
+
#endif
#if defined(__ELF__) && !defined(__USING_SJLJ_EXCEPTIONS__)
/* Protect against unhandled exceptions. */
@@ -396,7 +396,7 @@ __stack_base__: .word 0
StackLimit: .word 0
CommandLine: .space 256,0 /* Maximum length of 255 chars handled. */
#endif
-
+
#ifdef __pe__
.section .idata$3
.long 0,0,0,0,0,0,0,0
diff --git a/c/src/lib/libbsp/arm/gdbarmsim/startup/syscalls.c b/c/src/lib/libbsp/arm/gdbarmsim/startup/syscalls.c
index 5d4c0de9bb..c3effd91ec 100644
--- a/c/src/lib/libbsp/arm/gdbarmsim/startup/syscalls.c
+++ b/c/src/lib/libbsp/arm/gdbarmsim/startup/syscalls.c
@@ -64,11 +64,11 @@ struct fdent
#define MAX_OPEN_FILES 20
-/* User file descriptors (fd) are integer indexes into
+/* User file descriptors (fd) are integer indexes into
the openfiles[] array. Error checking is done by using
- findslot().
+ findslot().
- This openfiles array is manipulated directly by only
+ This openfiles array is manipulated directly by only
these 5 functions:
findslot() - Translate entry.
@@ -103,7 +103,7 @@ static int monitor_stdout;
static int monitor_stderr;
/* Return a pointer to the structure associated with
- the user file descriptor fd. */
+ the user file descriptor fd. */
static struct fdent*
findslot (int fd)
{
@@ -121,8 +121,8 @@ findslot (int fd)
return &openfiles[fd];
}
-/* Return the next lowest numbered free file
- structure, or -1 if we can't find one. */
+/* Return the next lowest numbered free file
+ structure, or -1 if we can't find one. */
static int
newslot (void)
{
@@ -142,7 +142,7 @@ void
initialise_monitor_handles (void)
{
int i;
-
+
/* Open the standard file descriptors by opening the special
* teletype device, ":tt", read-only to obtain a descritpor for
* standard input and write-only to obtain a descriptor for standard
@@ -155,7 +155,7 @@ initialise_monitor_handles (void)
#ifdef ARM_RDI_MONITOR
int volatile block[3];
-
+
block[0] = (int) ":tt";
block[2] = 3; /* length of filename */
block[1] = 0; /* mode "r" */
@@ -242,7 +242,7 @@ checkerror (int result)
/* fh, is a valid internal file handle.
ptr, is a null terminated string.
- len, is the length in bytes to read.
+ len, is the length in bytes to read.
Returns the number of bytes *not* written. */
int
_swiread (int fh,
@@ -251,11 +251,11 @@ _swiread (int fh,
{
#ifdef ARM_RDI_MONITOR
int block[3];
-
+
block[0] = fh;
block[1] = (int) ptr;
block[2] = len;
-
+
return checkerror (do_AngelSWI (AngelSWI_Reason_Read, block));
#else
register int r0 asm("r0");
@@ -271,7 +271,7 @@ _swiread (int fh,
#endif
}
-/* fd, is a valid user file handle.
+/* fd, is a valid user file handle.
Translates the return of _swiread into
bytes read. */
int
@@ -296,7 +296,7 @@ _read (int fd,
pfd->pos += len - res;
- /* res == len is not an error,
+ /* res == len is not an error,
at least if we want feof() to work. */
return len - res;
}
@@ -341,7 +341,7 @@ _swilseek (int fd,
}
dir = SEEK_SET;
}
-
+
#ifdef ARM_RDI_MONITOR
int block[2];
if (dir == SEEK_END)
@@ -352,7 +352,7 @@ _swilseek (int fd,
return -1;
ptr += res;
}
-
+
/* This code only does absolute seeks. */
block[0] = pfd->handle;
block[1] = ptr;
@@ -405,11 +405,11 @@ _swiwrite (
{
#ifdef ARM_RDI_MONITOR
int block[3];
-
+
block[0] = fh;
block[1] = (int) ptr;
block[2] = len;
-
+
return checkerror (do_AngelSWI (AngelSWI_Reason_Write, block));
#else
register int r0 asm("r0");
@@ -449,11 +449,11 @@ _write (int fd,
pfd->pos += len - res;
- /* We wrote 0 bytes?
+ /* We wrote 0 bytes?
Retrieve errno just in case. */
if ((len - res) == 0)
return error (0);
-
+
return (len - res);
}
@@ -464,7 +464,7 @@ _swiopen (const char * path, int flags)
#ifdef ARM_RDI_MONITOR
int block[3];
#endif
-
+
int fd = newslot ();
if (fd == -1)
@@ -472,9 +472,9 @@ _swiopen (const char * path, int flags)
errno = EMFILE;
return -1;
}
-
+
/* It is an error to open a file that already exists. */
- if ((flags & O_CREAT)
+ if ((flags & O_CREAT)
&& (flags & O_EXCL))
{
struct stat st;
@@ -487,15 +487,15 @@ _swiopen (const char * path, int flags)
}
}
- /* The flags are Unix-style, so we need to convert them. */
+ /* The flags are Unix-style, so we need to convert them. */
#ifdef O_BINARY
if (flags & O_BINARY)
aflags |= 1;
#endif
-
+
/* In O_RDONLY we expect aflags == 0. */
- if (flags & O_RDWR)
+ if (flags & O_RDWR)
aflags |= 2;
if ((flags & O_CREAT)
@@ -509,21 +509,21 @@ _swiopen (const char * path, int flags)
aflags &= ~4;
aflags |= 8;
}
-
+
#ifdef ARM_RDI_MONITOR
block[0] = (int) path;
block[2] = strlen (path);
block[1] = aflags;
-
+
fh = do_AngelSWI (AngelSWI_Reason_Open, block);
-
+
#else
asm ("mov r0,%2; mov r1, %3; swi %a1; mov %0, r0"
: "=r"(fh)
: "i" (SWI_Open),"r"(path),"r"(aflags)
: "r0","r1");
#endif
-
+
/* Return a user file descriptor or an error. */
if (fh >= 0)
{
@@ -550,8 +550,8 @@ _swiclose (int fh)
#else
register int r0 asm("r0");
r0 = fh;
- asm ("swi %a2"
- : "=r"(r0)
+ asm ("swi %a2"
+ : "=r"(r0)
: "0"(r0), "i" (SWI_Close));
return checkerror (r0);
#endif
@@ -605,9 +605,9 @@ _sbrk (int incr)
if (heap_end == NULL)
heap_end = & end;
-
+
prev_heap_end = heap_end;
-
+
if (heap_end + incr > stack_ptr)
{
/* Some of the libstdc++-v3 tests rely upon detecting
@@ -616,21 +616,21 @@ _sbrk (int incr)
extern void abort (void);
_write (1, "_sbrk: Heap and stack collision\n", 32);
-
+
abort ();
#else
errno = ENOMEM;
return (caddr_t) -1;
#endif
}
-
+
heap_end += incr;
return (caddr_t) prev_heap_end;
}
#endif
-int
+int
_swistat (int fd, struct stat * st)
{
struct fdent *pfd;
@@ -675,14 +675,14 @@ _stat (const char *fname, struct stat *st)
{
int fd, res;
memset (st, 0, sizeof (* st));
- /* The best we can do is try to open the file readonly.
+ /* The best we can do is try to open the file readonly.
If it exists, then we can guess a few things about it. */
if ((fd = _open (fname, O_RDONLY)) == -1)
return -1;
st->st_mode |= S_IFREG | S_IREAD;
res = _swistat (fd, st);
/* Not interested in the error. */
- _close (fd);
+ _close (fd);
return res;
}
@@ -705,12 +705,12 @@ _unlink (const char *path)
#else
register int r0 asm("r0");
r0 = (int)path;
- asm ("swi %a2"
+ asm ("swi %a2"
: "=r"(r0)
: "0"(r0), "i" (SWI_Remove));
res = r0;
#endif
- if (res == -1)
+ if (res == -1)
return error (res);
return 0;
}
@@ -747,7 +747,7 @@ _gettimeofday (struct timeval * tp, void * tzvp)
#endif
/* Return a clock that ticks at 100Hz. */
-clock_t
+clock_t
_clock (void)
{
clock_t timeval;
@@ -773,7 +773,7 @@ _times (struct tms * tp)
tp->tms_cutime = 0; /* user time, children */
tp->tms_cstime = 0; /* system time, children */
}
-
+
return timeval;
};
@@ -831,7 +831,7 @@ _system (const char *s)
#else
register int r0 asm("r0");
r0 = (int)s;
- asm ("swi %a2"
+ asm ("swi %a2"
: "=r" (r0)
: "0"(r0), "i" (SWI_CLI));
return checkerror (r0);
@@ -853,7 +853,7 @@ _rename (const char * oldpath, const char * newpath)
register int r1 asm("r1");
r0 = (int)oldpath;
r1 = (int)newpath;
- asm ("swi %a3"
+ asm ("swi %a3"
: "=r" (r0)
: "0" (r0), "r" (r1), "i" (SWI_Rename));
return checkerror (r0);
diff --git a/c/src/lib/libbsp/arm/gp32/console/uart.c b/c/src/lib/libbsp/arm/gp32/console/uart.c
index b619a378c7..635bc1ca6b 100644
--- a/c/src/lib/libbsp/arm/gp32/console/uart.c
+++ b/c/src/lib/libbsp/arm/gp32/console/uart.c
@@ -1,10 +1,10 @@
/*
* console driver for S3C2400 UARTs
*
- * This driver uses the shared console driver in
+ * This driver uses the shared console driver in
* ...../libbsp/shared/console.c
*
- * If you want the driver to be interrupt driven, you
+ * If you want the driver to be interrupt driven, you
* need to write the ISR, and in the ISR insert the
* chars into termios's queue.
*
@@ -53,8 +53,8 @@ console_data Console_Port_Data[NUM_DEVS];
rtems_device_minor_number Console_Port_Minor = 0;
/* Pointers to functions for handling the UART. */
-console_fns uart_fns =
-{
+console_fns uart_fns =
+{
libchip_serial_default_probe,
uart_first_open,
uart_last_close,
@@ -66,7 +66,7 @@ console_fns uart_fns =
FALSE /* TRUE if interrupt driven, FALSE if not. */
};
-/*
+/*
* There's one item in array for each UART.
*
* Some of these fields are marked "NOT USED". They are not used
@@ -99,25 +99,25 @@ console_tbl Console_Port_Tbl[] = {
/* Functions called via termios callbacks (i.e. the ones in uart_fns */
/*********************************************************************/
-/*
- * This is called the first time each device is opened. If the driver
- * is interrupt driven, you should enable interrupts here. Otherwise,
+/*
+ * This is called the first time each device is opened. If the driver
+ * is interrupt driven, you should enable interrupts here. Otherwise,
* it's probably safe to do nothing.
*
* Since micromonitor already set up the UART, we do nothing.
*/
-static int uart_first_open(int major, int minor, void *arg)
+static int uart_first_open(int major, int minor, void *arg)
{
return 0;
}
-/*
- * This is called the last time each device is closed. If the driver
- * is interrupt driven, you should disable interrupts here. Otherwise,
+/*
+ * This is called the last time each device is closed. If the driver
+ * is interrupt driven, you should disable interrupts here. Otherwise,
* it's probably safe to do nothing.
*/
-static int uart_last_close(int major, int minor, void *arg)
+static int uart_last_close(int major, int minor, void *arg)
{
return 0;
}
@@ -129,7 +129,7 @@ static int uart_last_close(int major, int minor, void *arg)
* Return -1 if there's no data, otherwise return
* the character in lowest 8 bits of returned int.
*/
-static int uart_read(int minor)
+static int uart_read(int minor)
{
char c;
@@ -148,8 +148,8 @@ static int uart_read(int minor)
}
-/*
- * Write buffer to UART
+/*
+ * Write buffer to UART
*
* return 1 on success, -1 on error
*/
@@ -163,14 +163,14 @@ static int uart_write(int minor, const char *buf, int len)
while(!(rUTRSTAT0 & 0x2)) {
continue;
}
-
+
rUTXH0 = (char) buf[i];
}
} else {
printk("Unknown console minor number: %d\n", minor);
return -1;
}
-
+
return 1;
}
@@ -180,13 +180,13 @@ static void uart_init(int minor)
{
int i;
unsigned int reg = 0;
-
+
/* enable UART0 */
rCLKCON|=0x100;
/* value is calculated so : (int)(PCLK/16./baudrate) -1 */
reg = get_PCLK() / (16 * 115200) - 1;
-
+
/* FIFO enable, Tx/Rx FIFO clear */
rUFCON0 = 0x07;
rUMCON0 = 0x0;
@@ -200,7 +200,7 @@ static void uart_init(int minor)
rUBRDIV0 = reg;
for (i = 0; i < 100; i++);
-
+
}
/* I'm not sure this is needed for the shared console driver. */
@@ -210,7 +210,7 @@ static void uart_write_polled(int minor, char c)
}
/* This is for setting baud rate, bits, etc. */
-static int uart_set_attributes(int minor, const struct termios *t)
+static int uart_set_attributes(int minor, const struct termios *t)
{
return 0;
}
@@ -221,7 +221,7 @@ static int uart_set_attributes(int minor, const struct termios *t)
* functions use them instead.
*/
/***********************************************************************/
-/*
+/*
* Read from UART. This is used in the exit code, and can't
* rely on interrupts.
*/
@@ -232,7 +232,7 @@ int uart_poll_read(int minor)
/*
- * Write a character to the console. This is used by printk() and
+ * Write a character to the console. This is used by printk() and
* maybe other low level functions. It should not use interrupts or any
* RTEMS system calls. It needs to be very simple
*/
diff --git a/c/src/lib/libbsp/arm/gp32/include/bsp.h b/c/src/lib/libbsp/arm/gp32/include/bsp.h
index f9b7eb1793..7866d01ebd 100644
--- a/c/src/lib/libbsp/arm/gp32/include/bsp.h
+++ b/c/src/lib/libbsp/arm/gp32/include/bsp.h
@@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------+
-| bsp.h - ARM BSP
+| bsp.h - ARM BSP
+--------------------------------------------------------------------------+
| This include file contains definitions related to the ARM BSP.
+--------------------------------------------------------------------------+
@@ -10,7 +10,7 @@
| The license and distribution terms for this file may be
| found in found in the file LICENSE in this distribution or at
| http://www.rtems.com/license/LICENSE.
-|
+|
| $Id$
+--------------------------------------------------------------------------*/
diff --git a/c/src/lib/libbsp/arm/gp32/smc/smc.c b/c/src/lib/libbsp/arm/gp32/smc/smc.c
index f204f7456c..118eaffc43 100644
--- a/c/src/lib/libbsp/arm/gp32/smc/smc.c
+++ b/c/src/lib/libbsp/arm/gp32/smc/smc.c
@@ -1,7 +1,7 @@
/* smc.c -- s3c2400 smc disk block device implementation
- Squidge's SMC Low-level access routines.
- Inspired and derived from routines provided by Samsung Electronics M/M R&D Center & FireFly.
+ Squidge's SMC Low-level access routines.
+ Inspired and derived from routines provided by Samsung Electronics M/M R&D Center & FireFly.
*/
@@ -96,7 +96,7 @@ static void sm_write( uint8_t data)
static uint8_t sm_read(void)
{
uint8_t data;
-
+
rPDDAT &= (~0x100);
data = rPBDAT & 0xFF;
rPDDAT |= 0x100;
@@ -135,7 +135,7 @@ static uint8_t sm_status()
void smc_read_id( uint8_t* buf, uint32_t length)
{
-
+
uint32_t i;
sm_chip_en();
@@ -163,8 +163,8 @@ void smc_read_id( uint8_t* buf, uint32_t length)
uint8_t smc_read_page (uint32_t lpage, uint8_t* buf)
{
uint32_t block, page, i;
-
- /* convert logical block to physical block
+
+ /* convert logical block to physical block
and then convert into page suitable for read1 command...
*/
block = lpage >> 5;
@@ -174,9 +174,9 @@ uint8_t smc_read_page (uint32_t lpage, uint8_t* buf)
}
else
return 0;
-
+
sm_chip_en();
-
+
sm_cle_en();
sm_write_en();
sm_write(READ1_CMD);
@@ -191,20 +191,20 @@ uint8_t smc_read_page (uint32_t lpage, uint8_t* buf)
if (smc_info.mb >= 64) sm_write( (uint8_t)(page >> 16));
sm_write_dis();
sm_ale_dis();
-
+
sm_busy();
-
+
sm_read_en();
for (i = 0; i < 512; i++)
- {
+ {
*buf = sm_read();
buf++;
}
sm_read_dis();
sm_chip_dis();
-
+
sm_busy();
- return 1;
+ return 1;
}
void smc_read_spare( uint32_t page, uint8_t* buf, uint8_t length)
@@ -257,7 +257,7 @@ void smc_make_l2p(void)
{
/* read physical block - first page */
smc_read_spare( pblock*smc_info.pages_per_block, (uint8_t*)&data, 16);
-
+
zone = pblock >> 10; /* divide by 1024 to get zone */
if ((data[5] == 0xFF) && ((data[6]&0xF8) == 0x10))
{
@@ -282,7 +282,7 @@ void smc_make_l2p(void)
{
smc_p2l[pblock] = BLOCK_RESERVED;
cnt3++;
- }
+ }
}
}
}
@@ -327,7 +327,7 @@ void smc_init( void)
{
unsigned char buf[32];
int i;
-
+
/* reset smc */
sm_chip_en();
sm_cle_en();
@@ -335,16 +335,16 @@ void smc_init( void)
sm_write(0xFF);
sm_write_dis();
sm_cle_dis();
- for(i=0;i<10;i++);
+ for(i=0;i<10;i++);
sm_busy();
sm_chip_dis();
-
+
smc_read_id (buf, 4);
smc_detect (buf[0], buf[1], buf[2]);
printk ("SMC: [%02X-%02X-%02X-%02X]\n", buf[0], buf[1], buf[2], buf[3]);
printk ("SMC size: %dMB detected\n",smc_info.mb);
smc_make_l2p();
-}
+}
/**********
* Function: sm_ECCEncode (completely ripped, unaltered, from the samsung routines)
@@ -352,7 +352,7 @@ void smc_init( void)
* - adopted from "ECC Algorithm for SmartMedia V3.0"
* by Memory Product & Technology, Samsung Electronics Co. (ecc30.pdf)
**********/
-int sm_ECCEncode(const uint8_t * p_buf, uint8_t * p_ecc)
+int sm_ECCEncode(const uint8_t * p_buf, uint8_t * p_ecc)
{
uint32_t i, j;
uint8_t paritr[256], tmp = 0, tmp2 = 0;
@@ -368,13 +368,13 @@ int sm_ECCEncode(const uint8_t * p_buf, uint8_t * p_ecc)
uint8_t* paritr_ptr;
paritr_ptr = paritr;
- for (i = 0; i < 256; ++i, ++paritr_ptr, ++p_buf)
+ for (i = 0; i < 256; ++i, ++paritr_ptr, ++p_buf)
{
paritc ^= *p_buf;
tmp = (*p_buf & 0xf0) >> 4;
tmp2 = *p_buf & 0x0f;
- switch (tmp)
+ switch (tmp)
{
case 0:
case 3:
@@ -416,79 +416,79 @@ int sm_ECCEncode(const uint8_t * p_buf, uint8_t * p_ecc)
parit4_1 = parit7c ^ parit6c ^ parit5c ^ parit4c;
paritr_ptr = paritr;
- for (i = 0; i < 256; ++i, ++paritr_ptr)
+ for (i = 0; i < 256; ++i, ++paritr_ptr)
{
sum ^= *paritr_ptr;
}
paritr_ptr = paritr;
- for (i = 0; i < 256; i += 2, paritr_ptr += 2)
+ for (i = 0; i < 256; i += 2, paritr_ptr += 2)
{
parit8_2 ^= *paritr_ptr;
}
paritr_ptr = paritr;
- for (i = 0; i < 256; i += 4, paritr_ptr += 4)
+ for (i = 0; i < 256; i += 4, paritr_ptr += 4)
{
parit16_2 ^= *paritr_ptr;
parit16_2 ^= *(paritr_ptr + 1);
}
paritr_ptr = paritr;
- for (i = 0; i < 256; i += 8, paritr_ptr += 8)
+ for (i = 0; i < 256; i += 8, paritr_ptr += 8)
{
- for (j = 0; j <= 3; ++j)
+ for (j = 0; j <= 3; ++j)
{
parit32_2 ^= *(paritr_ptr + j);
}
}
paritr_ptr = paritr;
- for (i = 0; i < 256; i += 16, paritr_ptr += 16)
+ for (i = 0; i < 256; i += 16, paritr_ptr += 16)
{
- for (j = 0; j <= 7; ++j)
+ for (j = 0; j <= 7; ++j)
{
parit64_2 ^= *(paritr_ptr + j);
}
}
paritr_ptr = paritr;
- for (i = 0; i < 256; i += 32, paritr_ptr += 32)
+ for (i = 0; i < 256; i += 32, paritr_ptr += 32)
{
- for (j = 0; j <= 15; ++j)
+ for (j = 0; j <= 15; ++j)
{
parit128_2 ^= *(paritr_ptr + j);
}
}
paritr_ptr = paritr;
- for (i = 0; i < 256; i += 64, paritr_ptr += 64)
+ for (i = 0; i < 256; i += 64, paritr_ptr += 64)
{
- for (j = 0; j <= 31; ++j)
+ for (j = 0; j <= 31; ++j)
{
parit256_2 ^= *(paritr_ptr + j);
}
}
paritr_ptr = paritr;
- for (i = 0; i < 256; i += 128, paritr_ptr += 128)
+ for (i = 0; i < 256; i += 128, paritr_ptr += 128)
{
- for (j = 0; j <= 63; ++j)
+ for (j = 0; j <= 63; ++j)
{
parit512_2 ^= *(paritr_ptr + j);
}
}
paritr_ptr = paritr;
- for (i = 0; i < 256; i += 256, paritr_ptr += 256)
+ for (i = 0; i < 256; i += 256, paritr_ptr += 256)
{
- for (j = 0; j <= 127; ++j)
+ for (j = 0; j <= 127; ++j)
{
parit1024_2 ^= *(paritr_ptr + j);
}
}
- if (sum==0)
+ if (sum==0)
{
parit1024_1 = parit1024_2;
parit512_1 = parit512_2;
@@ -499,7 +499,7 @@ int sm_ECCEncode(const uint8_t * p_buf, uint8_t * p_ecc)
parit16_1 = parit16_2;
parit8_1 = parit8_2;
}
- else
+ else
{
parit1024_1 = parit1024_2 ? 0 : 1;
parit512_1 = parit512_2 ? 0 : 1;
diff --git a/c/src/lib/libbsp/arm/gp32/start/start.S b/c/src/lib/libbsp/arm/gp32/start/start.S
index b7faf5eb23..e3be252332 100644
--- a/c/src/lib/libbsp/arm/gp32/start/start.S
+++ b/c/src/lib/libbsp/arm/gp32/start/start.S
@@ -1,7 +1,7 @@
/*
* GP32 startup code
*
- *
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
*
@@ -15,7 +15,7 @@
#warning The call is "void boot_card(const char* cmdline);"
#warning You need to pass a NULL.
#warning Please check and remove these warnings.
-
+
/* Some standard definitions...*/
.equ PSR_MODE_USR, 0x10
.equ PSR_MODE_FIQ, 0x11
@@ -68,16 +68,16 @@ _start:
_start2:
@---------------------------------------------------------------------------------
- /*
+ /*
* Since I don't plan to return to the bootloader,
* I don't have to save the registers.
*
- * I'll just set the CPSR for SVC mode, interrupts
+ * I'll just set the CPSR for SVC mode, interrupts
* off, and ARM instructions.
*/
mov r0, #(PSR_MODE_SVC | PSR_I | PSR_F)
msr cpsr, r0
-
+
/* --- Initialize stack pointer registers */
/* Enter IRQ mode and set up the IRQ stack pointer */
mov r0, #(PSR_MODE_IRQ | PSR_I | PSR_F) /* No interrupts */
@@ -99,7 +99,7 @@ _start2:
ldr r1, =_abt_stack_size
ldr sp, =_abt_stack
add sp, sp, r1
-
+
/* Set up the SVC stack pointer last and stay in SVC mode */
mov r0, #(PSR_MODE_SVC | PSR_I | PSR_F) /* No interrupts */
msr cpsr, r0
@@ -107,7 +107,7 @@ _start2:
ldr sp, =_svc_stack
add sp, sp, r1
sub sp, sp, #0x64
-
+
/* disable mmu, I and D caches*/
nop
@@ -124,7 +124,7 @@ _start2:
mov r1,#0x00
Loop1:
mov r2,#0x00
-Loop2:
+Loop2:
mov r3, r2, lsl#26
orr r3, r3, r1, lsl#5
mcr p15, 0, r3, c7, c14, 2
@@ -134,19 +134,19 @@ Loop2:
add r1, r1, #0x01
cmp r1, #8
bne Loop1
-
- /*
+
+ /*
* Initialize the MMU. After we return, the MMU is enabled,
* and memory may be remapped. I hope we don't remap this
* memory away.
*/
ldr r0, =mem_map
- bl mmu_init
+ bl mmu_init
- /*
+ /*
* Initialize the exception vectors. This includes the
- * exceptions vectors (0x00000000-0x0000001c), and the
+ * exceptions vectors (0x00000000-0x0000001c), and the
* pointers to the exception handlers (0x00000020-0x0000003c).
*/
mov r0, #0
@@ -155,11 +155,11 @@ Loop2:
stmia r0!, {r2-r9}
ldmia r1!, {r2-r9}
stmia r0!, {r2-r9}
-
+
/* Now we are prepared to start the BSP's C code */
bl boot_card
- /*
+ /*
* Theoretically, we could return to what started us up,
* but we'd have to have saved the registers and stacks.
* Instead, we'll just reset.
@@ -169,13 +169,13 @@ Loop2:
/* We shouldn't get here. If we do, hang */
_hang: b _hang
-
-/*
+
+/*
* This is the exception vector table and the pointers to
* the functions that handle the exceptions. It's a total
* of 16 words (64 bytes)
*/
-vector_block:
+vector_block:
ldr pc, Reset_Handler
ldr pc, Undefined_Handler
ldr pc, SWI_Handler
@@ -187,7 +187,7 @@ vector_block:
Reset_Handler: b bsp_reset
Undefined_Handler: b Undefined_Handler
-SWI_Handler: b SWI_Handler
+SWI_Handler: b SWI_Handler
Prefetch_Handler: b Prefetch_Handler
Abort_Handler: b Abort_Handler
nop
diff --git a/c/src/lib/libbsp/arm/gp32/startup/bspreset.c b/c/src/lib/libbsp/arm/gp32/startup/bspreset.c
index 9484a62bdc..15586749cb 100644
--- a/c/src/lib/libbsp/arm/gp32/startup/bspreset.c
+++ b/c/src/lib/libbsp/arm/gp32/startup/bspreset.c
@@ -4,7 +4,7 @@
* http://www.rtems.com/license/LICENSE.
*
* $Id$
- */
+ */
#include <bsp.h>
diff --git a/c/src/lib/libbsp/arm/gp32/startup/bspstart.c b/c/src/lib/libbsp/arm/gp32/startup/bspstart.c
index 669ea9c05f..be211505bd 100644
--- a/c/src/lib/libbsp/arm/gp32/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/gp32/startup/bspstart.c
@@ -1,7 +1,7 @@
/*
* This file contains the ARM BSP startup package. It includes application,
* board, and monitor specific initialization and configuration. The generic CPU
- * dependent initialization has been performed before this routine is invoked.
+ * dependent initialization has been performed before this routine is invoked.
*
*
* Copyright (c) 2000 Canon Research Centre France SA.
@@ -12,7 +12,7 @@
* http://www.rtems.com/license/LICENSE.
*
* $Id$
- */
+ */
#include <bsp.h>
#include <rtems/bspIo.h>
@@ -32,7 +32,7 @@ Thread bsp_idle_task(uint32_t ignored)
asm volatile ("MCR p15,0,r0,c7,c0,4 \n");
}
}
-
+
/*
* BSP Specific Initialization in C
*/
diff --git a/c/src/lib/libbsp/arm/gumstix/console/uarts.c b/c/src/lib/libbsp/arm/gumstix/console/uarts.c
index 2186aa53a0..7feec461c6 100755
--- a/c/src/lib/libbsp/arm/gumstix/console/uarts.c
+++ b/c/src/lib/libbsp/arm/gumstix/console/uarts.c
@@ -1,11 +1,11 @@
/*
* Console driver for GUMSTIX by Yang Xi <hiyangxi@gmail.com>
*
- * This driver uses the shared console driver in
+ * This driver uses the shared console driver in
* ...../libbsp/shared/console.c
*
* Copyright (c) 2003 by Cogent Computer Systems
- * Written by Jay Monkman <jtm@lopingdog.com>
+ * Written by Jay Monkman <jtm@lopingdog.com>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -34,7 +34,7 @@ console_data Console_Port_Data[NUM_DEVS];
rtems_device_minor_number Console_Port_Minor = 0;
extern console_fns ffuart_fns;
-/*
+/*
* There's one item in array for each UART.
*
* Some of these fields are marked "NOT USED". They are not used
diff --git a/c/src/lib/libbsp/arm/gumstix/fb/fb.c b/c/src/lib/libbsp/arm/gumstix/fb/fb.c
index 61a37b3bfa..66725b7981 100644
--- a/c/src/lib/libbsp/arm/gumstix/fb/fb.c
+++ b/c/src/lib/libbsp/arm/gumstix/fb/fb.c
@@ -33,16 +33,16 @@ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static struct fb_var_screeninfo fb_var =
{
- .xres = SCREEN_WIDTH,
- .yres = SCREEN_HEIGHT,
+ .xres = SCREEN_WIDTH,
+ .yres = SCREEN_HEIGHT,
.bits_per_pixel = BPP
};
static struct fb_fix_screeninfo fb_fix =
{
- .smem_start = (volatile char *)LCD_DMA_POINTER,
- .smem_len = LCD_BUFFER_SIZE,
- .type = FB_TYPE_PACKED_PIXELS,
+ .smem_start = (volatile char *)LCD_DMA_POINTER,
+ .smem_len = LCD_BUFFER_SIZE,
+ .type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_TRUECOLOR,
.line_length = SCREEN_WIDTH * (BPP/8)
};
@@ -70,7 +70,7 @@ static void enable_fbskyeye(void)
LCCR3 |= 4<<24;
FDADR0 = LCD_DMA_POINTER - 0x1000;
LCCR0 |= LCCR0_ENB;
-}
+}
static void disable_fbskyeye(void)
@@ -119,8 +119,8 @@ frame_buffer_open( rtems_device_major_number major,
if (pthread_mutex_trylock(&mutex)== 0){
/* restore previous state. for VGA this means return to text mode.
* leave out if graphics hardware has been initialized in
- * frame_buffer_initialize()
- */
+ * frame_buffer_initialize()
+ */
printk( "FBSKYEYE open called.\n" );
enable_fbskyeye();
return RTEMS_SUCCESSFUL;
@@ -166,7 +166,7 @@ frame_buffer_write( rtems_device_major_number major,
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *)arg;
rw_args->bytes_moved = ((rw_args->offset + rw_args->count) > fb_fix.smem_len ) ? (fb_fix.smem_len - rw_args->offset) : rw_args->count;
memcpy( (void *) (fb_fix.smem_start + rw_args->offset), rw_args->buffer, rw_args->bytes_moved);
- return RTEMS_SUCCESSFUL;
+ return RTEMS_SUCCESSFUL;
}
static int get_palette( struct fb_cmap *cmap )
diff --git a/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c b/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
index 3a2cf6b5b4..4754e0e67e 100644
--- a/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
+++ b/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
@@ -239,8 +239,8 @@ ne_read_data (struct ne_softc *sc, int addr, int len, unsigned char *p)
{
unsigned char d;
while (len > 0)
- {
- inport_byte(dport, d);
+ {
+ inport_byte(dport, d);
*p++ = d;
len--;
}
@@ -309,7 +309,7 @@ ne_check_status (struct ne_softc *sc, int from_irq_handler)
if (from_irq_handler)
outport_byte(port + IMR, NE_INTERRUPTS);
return;
- }
+ }
/* Check for transmitted packet. The transmit daemon may now be
able to send another packet to the device. */
@@ -346,7 +346,7 @@ ne_check_status (struct ne_softc *sc, int from_irq_handler)
}
outport_byte (port + CMDR, MSK_PG0 | MSK_STA | MSK_RD2);
-
+
}
/* Handle an NE2000 interrupt. */
@@ -399,7 +399,7 @@ ne_interrupt_off (const rtems_irq_connect_data *irq)
outport_byte (sc->port + IMR, 0);
}
-/*
+/*
*Return whether NE2000 interrupts are on.
*If it is eanbled, return 1
*/
@@ -581,7 +581,7 @@ ne_rx_daemon (void *arg)
reset = 0;
/* Read the buffer header */
- startaddr = startpage * NE_PAGE_SIZE;
+ startaddr = startpage * NE_PAGE_SIZE;
ne_read_data(sc, startaddr, sizeof(hdr), (unsigned char *)&hdr);
next = hdr.next;
@@ -657,7 +657,7 @@ ne_rx_daemon (void *arg)
m->m_pkthdr.rcvif = ifp;
m->m_nextpkt = 0;
- p = mtod (m, unsigned char *);
+ p = mtod (m, unsigned char *);
m->m_len = m->m_pkthdr.len = len - (sizeof(struct ether_header) + 2);
toend = NE_STOP_PAGE * NE_PAGE_SIZE - startaddr;
@@ -671,7 +671,7 @@ ne_rx_daemon (void *arg)
if (len > 0)
ne_read_data (sc, startaddr, len, p);
-
+
m->m_data +=2;
eh = mtod(m, struct ether_header *);
m->m_data += sizeof (struct ether_header);
@@ -1185,7 +1185,7 @@ rtems_ne_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
/* We use 16 as the default IRQ. */
sc->irno = XSCALE_IRQ_NETWORK;
-
+
/*IO prts are mapped to 0X40000600 */
diff --git a/c/src/lib/libbsp/arm/gumstix/start/start.S b/c/src/lib/libbsp/arm/gumstix/start/start.S
index 882e213eb8..bb4aa5f654 100755
--- a/c/src/lib/libbsp/arm/gumstix/start/start.S
+++ b/c/src/lib/libbsp/arm/gumstix/start/start.S
@@ -9,7 +9,7 @@
* $Id$
*/
-
+
/* Some standard definitions...*/
.equ PSR_MODE_USR, 0x10
.equ PSR_MODE_FIQ, 0x11
@@ -26,11 +26,11 @@
.text
.globl _start
_start:
- /*
+ /*
* Since I don't plan to return to the bootloader,
* I don't have to save the registers.
*
- * I'll just set the CPSR for SVC mode, interrupts
+ * I'll just set the CPSR for SVC mode, interrupts
* off, and ARM instructions.
*/
mov r0, #(PSR_MODE_SVC | PSR_I | PSR_F)
@@ -41,11 +41,11 @@ _start:
ldr r1, =_bss_end_
ldr r0, =_bss_start_
-_bss_init:
+_bss_init:
mov r2, #0
cmp r0, r1
strlot r2, [r0], #4
- blo _bss_init /* loop while r0 < r1 */
+ blo _bss_init /* loop while r0 < r1 */
/* --- Initialize stack pointer registers */
/* Enter IRQ mode and set up the IRQ stack pointer */
@@ -68,16 +68,16 @@ _bss_init:
ldr r1, =_abt_stack_size
ldr sp, =_abt_stack
add sp, sp, r1
-
+
/* Set up the SVC stack pointer last and stay in SVC mode */
mov r0, #(PSR_MODE_SVC | PSR_I | PSR_F) /* No interrupts */
msr cpsr, r0
ldr r1, =_svc_stack_size
ldr sp, =_svc_stack
add sp, sp, r1
- sub sp, sp, #0x64
+ sub sp, sp, #0x64
- /*
+ /*
* Initialize the MMU. After we return, the MMU is enabled,
* and memory may be remapped. I hope we don't remap this
* memory away.
@@ -88,9 +88,9 @@ _bss_init:
- /*
+ /*
* Initialize the exception vectors. This includes the
- * exceptions vectors (0x00000000-0x0000001c), and the
+ * exceptions vectors (0x00000000-0x0000001c), and the
* pointers to the exception handlers (0x00000020-0x0000003c).
*/
mov r0, #0
@@ -105,7 +105,7 @@ _bss_init:
/* Now we are prepared to start the BSP's C code */
bl boot_card
- /*
+ /*
* Theoretically, we could return to what started us up,
* but we'd have to have saved the registers and stacks.
* Instead, we'll just reset.
@@ -115,13 +115,13 @@ _bss_init:
/* We shouldn't get here. If we do, hang */
_hang: b _hang
-
-/*
+
+/*
* This is the exception vector table and the pointers to
* the functions that handle the exceptions. It's a total
* of 16 words (64 bytes)
*/
-vector_block:
+vector_block:
ldr pc, Reset_Handler
ldr pc, Undefined_Handler
ldr pc, SWI_Handler
@@ -133,7 +133,7 @@ vector_block:
Reset_Handler: b bsp_reset
Undefined_Handler: b Undefined_Handler
-SWI_Handler: b SWI_Handler
+SWI_Handler: b SWI_Handler
Prefetch_Handler: b Prefetch_Handler
Abort_Handler: b Abort_Handler
nop
diff --git a/c/src/lib/libbsp/arm/gumstix/startup/memmap.c b/c/src/lib/libbsp/arm/gumstix/startup/memmap.c
index f30518735b..fd98b49c17 100755
--- a/c/src/lib/libbsp/arm/gumstix/startup/memmap.c
+++ b/c/src/lib/libbsp/arm/gumstix/startup/memmap.c
@@ -14,6 +14,6 @@ mmu_sect_map_t mem_map[] = {
/* <phys addr> <virt addr> <size> <flags> */
{0x40000000, 0x40000000, 1216, MMU_CACHE_NONE}, /*Map I/O*/
{0xA0000000, 0x00000000, 1, MMU_CACHE_NONE}, /*sram*/
- {0xA0000000, 0xA0000000, 64, MMU_CACHE_WBACK}, /* SDRAM */
+ {0xA0000000, 0xA0000000, 64, MMU_CACHE_WBACK}, /* SDRAM */
{0x00000000, 0x00000000, 0, 0} /* The end */
};
diff --git a/c/src/lib/libbsp/arm/lpc24xx/clock/clock-config.c b/c/src/lib/libbsp/arm/lpc24xx/clock/clock-config.c
index 83f0e03ed2..35b7eabba2 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/clock/clock-config.c
+++ b/c/src/lib/libbsp/arm/lpc24xx/clock/clock-config.c
@@ -107,16 +107,16 @@ static uint32_t lpc24xx_clock_nanoseconds_since_last_tick( void)
uint64_t clock = LPC24XX_CCLK;
uint32_t clicks = T0TC;
uint64_t ns = ((uint64_t) clicks * 1000000000) / clock;
-
+
return (uint32_t) ns;
}
-
+
#define Clock_driver_support_initialize_hardware() lpc24xx_clock_initialize()
#define Clock_driver_support_install_isr( isr, old_isr) lpc24xx_clock_handler_install()
#define Clock_driver_support_shutdown_hardware() lpc24xx_clock_cleanup()
-
+
#define Clock_driver_nanoseconds_since_last_tick lpc24xx_clock_nanoseconds_since_last_tick
/* Include shared source clock driver code */
diff --git a/c/src/lib/libbsp/arm/lpc24xx/console/console-config.c b/c/src/lib/libbsp/arm/lpc24xx/console/console-config.c
index d639ef9818..fd0c26484f 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/console/console-config.c
+++ b/c/src/lib/libbsp/arm/lpc24xx/console/console-config.c
@@ -36,7 +36,7 @@ static void lpc24xx_uart_set_register( uint32_t addr, uint8_t i, uint8_t val)
{
volatile uint32_t *reg = (volatile uint32_t *) addr;
- reg [i] = val;
+ reg [i] = val;
}
rtems_device_minor_number Console_Port_Minor = 0;
diff --git a/c/src/lib/libbsp/arm/lpc24xx/include/bsp.h b/c/src/lib/libbsp/arm/lpc24xx/include/bsp.h
index e1f06b2ee3..75a6731507 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/include/bsp.h
+++ b/c/src/lib/libbsp/arm/lpc24xx/include/bsp.h
@@ -77,7 +77,7 @@ int lpc24xx_eth_attach_detach(
*
* @code
* #include <bsp.h>
- *
+ *
* #define CONFIGURE_INIT
*
* #define CONFIGURE_IDLE_TASK_BODY lpc24xx_idle
diff --git a/c/src/lib/libbsp/arm/lpc24xx/include/lpc24xx.h b/c/src/lib/libbsp/arm/lpc24xx/include/lpc24xx.h
index 98a6156cbd..b4da9f5096 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/include/lpc24xx.h
+++ b/c/src/lib/libbsp/arm/lpc24xx/include/lpc24xx.h
@@ -157,13 +157,13 @@
#define IOCLR1 (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x1C))
/* GPIO Interrupt Registers */
-#define IO0_INT_EN_R (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x90))
+#define IO0_INT_EN_R (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x90))
#define IO0_INT_EN_F (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x94))
#define IO0_INT_STAT_R (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x84))
#define IO0_INT_STAT_F (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x88))
#define IO0_INT_CLR (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x8C))
-#define IO2_INT_EN_R (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0xB0))
+#define IO2_INT_EN_R (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0xB0))
#define IO2_INT_EN_F (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0xB4))
#define IO2_INT_STAT_R (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0xA4))
#define IO2_INT_STAT_F (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0xA8))
@@ -172,224 +172,224 @@
#define IO_INT_STAT (*(volatile uint32_t *) (GPIO_BASE_ADDR + 0x80))
#define PARTCFG_BASE_ADDR 0x3FFF8000
-#define PARTCFG (*(volatile uint32_t *) (PARTCFG_BASE_ADDR + 0x00))
+#define PARTCFG (*(volatile uint32_t *) (PARTCFG_BASE_ADDR + 0x00))
/* Fast I/O setup */
#define FIO_BASE_ADDR 0x3FFFC000
-#define FIO0DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x00))
+#define FIO0DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x00))
#define FIO0MASK (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x10))
#define FIO0PIN (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x14))
#define FIO0SET (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x18))
#define FIO0CLR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x1C))
-#define FIO1DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x20))
+#define FIO1DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x20))
#define FIO1MASK (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x30))
#define FIO1PIN (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x34))
#define FIO1SET (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x38))
#define FIO1CLR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x3C))
-#define FIO2DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x40))
+#define FIO2DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x40))
#define FIO2MASK (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x50))
#define FIO2PIN (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x54))
#define FIO2SET (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x58))
#define FIO2CLR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x5C))
-#define FIO3DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x60))
+#define FIO3DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x60))
#define FIO3MASK (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x70))
#define FIO3PIN (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x74))
#define FIO3SET (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x78))
#define FIO3CLR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x7C))
-#define FIO4DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x80))
+#define FIO4DIR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x80))
#define FIO4MASK (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x90))
#define FIO4PIN (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x94))
#define FIO4SET (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x98))
#define FIO4CLR (*(volatile uint32_t *) (FIO_BASE_ADDR + 0x9C))
/* FIOs can be accessed through WORD, HALF-WORD or BYTE. */
-#define FIO0DIR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x01))
-#define FIO1DIR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x21))
-#define FIO2DIR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x41))
-#define FIO3DIR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x61))
-#define FIO4DIR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x81))
-
-#define FIO0DIR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x02))
-#define FIO1DIR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x22))
-#define FIO2DIR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x42))
-#define FIO3DIR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x62))
-#define FIO4DIR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x82))
-
-#define FIO0DIR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x03))
-#define FIO1DIR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x23))
-#define FIO2DIR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x43))
-#define FIO3DIR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x63))
-#define FIO4DIR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x83))
-
-#define FIO0DIR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x04))
-#define FIO1DIR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x24))
-#define FIO2DIR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x44))
-#define FIO3DIR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x64))
-#define FIO4DIR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x84))
-
-#define FIO0DIRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x00))
-#define FIO1DIRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x20))
-#define FIO2DIRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x40))
-#define FIO3DIRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x60))
-#define FIO4DIRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x80))
-
-#define FIO0DIRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x02))
-#define FIO1DIRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x22))
-#define FIO2DIRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x42))
-#define FIO3DIRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x62))
-#define FIO4DIRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x82))
-
-#define FIO0MASK0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x10))
-#define FIO1MASK0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x30))
-#define FIO2MASK0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x50))
-#define FIO3MASK0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x70))
-#define FIO4MASK0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x90))
-
-#define FIO0MASK1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x11))
-#define FIO1MASK1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x21))
-#define FIO2MASK1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x51))
-#define FIO3MASK1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x71))
-#define FIO4MASK1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x91))
-
-#define FIO0MASK2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x12))
-#define FIO1MASK2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x32))
-#define FIO2MASK2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x52))
-#define FIO3MASK2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x72))
-#define FIO4MASK2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x92))
-
-#define FIO0MASK3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x13))
-#define FIO1MASK3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x33))
-#define FIO2MASK3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x53))
-#define FIO3MASK3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x73))
-#define FIO4MASK3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x93))
-
-#define FIO0MASKL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x10))
-#define FIO1MASKL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x30))
-#define FIO2MASKL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x50))
-#define FIO3MASKL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x70))
-#define FIO4MASKL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x90))
-
-#define FIO0MASKU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x12))
-#define FIO1MASKU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x32))
-#define FIO2MASKU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x52))
-#define FIO3MASKU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x72))
-#define FIO4MASKU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x92))
-
-#define FIO0PIN0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x14))
-#define FIO1PIN0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x34))
-#define FIO2PIN0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x54))
-#define FIO3PIN0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x74))
-#define FIO4PIN0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x94))
-
-#define FIO0PIN1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x15))
-#define FIO1PIN1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x25))
-#define FIO2PIN1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x55))
-#define FIO3PIN1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x75))
-#define FIO4PIN1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x95))
-
-#define FIO0PIN2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x16))
-#define FIO1PIN2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x36))
-#define FIO2PIN2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x56))
-#define FIO3PIN2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x76))
-#define FIO4PIN2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x96))
-
-#define FIO0PIN3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x17))
-#define FIO1PIN3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x37))
-#define FIO2PIN3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x57))
-#define FIO3PIN3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x77))
-#define FIO4PIN3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x97))
-
-#define FIO0PINL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x14))
-#define FIO1PINL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x34))
-#define FIO2PINL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x54))
-#define FIO3PINL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x74))
-#define FIO4PINL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x94))
-
-#define FIO0PINU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x16))
-#define FIO1PINU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x36))
-#define FIO2PINU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x56))
-#define FIO3PINU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x76))
-#define FIO4PINU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x96))
-
-#define FIO0SET0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x18))
-#define FIO1SET0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x38))
-#define FIO2SET0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x58))
-#define FIO3SET0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x78))
-#define FIO4SET0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x98))
-
-#define FIO0SET1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x19))
-#define FIO1SET1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x29))
-#define FIO2SET1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x59))
-#define FIO3SET1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x79))
-#define FIO4SET1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x99))
-
-#define FIO0SET2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1A))
-#define FIO1SET2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x3A))
-#define FIO2SET2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5A))
-#define FIO3SET2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7A))
-#define FIO4SET2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9A))
-
-#define FIO0SET3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1B))
-#define FIO1SET3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x3B))
-#define FIO2SET3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5B))
-#define FIO3SET3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7B))
-#define FIO4SET3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9B))
-
-#define FIO0SETL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x18))
-#define FIO1SETL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x38))
-#define FIO2SETL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x58))
-#define FIO3SETL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x78))
-#define FIO4SETL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x98))
-
-#define FIO0SETU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x1A))
-#define FIO1SETU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x3A))
-#define FIO2SETU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x5A))
-#define FIO3SETU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x7A))
-#define FIO4SETU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x9A))
-
-#define FIO0CLR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1C))
-#define FIO1CLR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x3C))
-#define FIO2CLR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5C))
-#define FIO3CLR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7C))
-#define FIO4CLR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9C))
-
-#define FIO0CLR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1D))
-#define FIO1CLR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x2D))
-#define FIO2CLR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5D))
-#define FIO3CLR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7D))
-#define FIO4CLR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9D))
-
-#define FIO0CLR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1E))
-#define FIO1CLR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x3E))
-#define FIO2CLR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5E))
-#define FIO3CLR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7E))
-#define FIO4CLR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9E))
-
-#define FIO0CLR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1F))
-#define FIO1CLR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x3F))
-#define FIO2CLR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5F))
-#define FIO3CLR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7F))
-#define FIO4CLR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9F))
-
-#define FIO0CLRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x1C))
-#define FIO1CLRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x3C))
-#define FIO2CLRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x5C))
-#define FIO3CLRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x7C))
-#define FIO4CLRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x9C))
-
-#define FIO0CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x1E))
-#define FIO1CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x3E))
-#define FIO2CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x5E))
-#define FIO3CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x7E))
-#define FIO4CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x9E))
+#define FIO0DIR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x01))
+#define FIO1DIR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x21))
+#define FIO2DIR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x41))
+#define FIO3DIR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x61))
+#define FIO4DIR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x81))
+
+#define FIO0DIR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x02))
+#define FIO1DIR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x22))
+#define FIO2DIR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x42))
+#define FIO3DIR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x62))
+#define FIO4DIR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x82))
+
+#define FIO0DIR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x03))
+#define FIO1DIR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x23))
+#define FIO2DIR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x43))
+#define FIO3DIR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x63))
+#define FIO4DIR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x83))
+
+#define FIO0DIR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x04))
+#define FIO1DIR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x24))
+#define FIO2DIR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x44))
+#define FIO3DIR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x64))
+#define FIO4DIR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x84))
+
+#define FIO0DIRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x00))
+#define FIO1DIRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x20))
+#define FIO2DIRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x40))
+#define FIO3DIRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x60))
+#define FIO4DIRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x80))
+
+#define FIO0DIRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x02))
+#define FIO1DIRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x22))
+#define FIO2DIRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x42))
+#define FIO3DIRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x62))
+#define FIO4DIRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x82))
+
+#define FIO0MASK0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x10))
+#define FIO1MASK0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x30))
+#define FIO2MASK0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x50))
+#define FIO3MASK0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x70))
+#define FIO4MASK0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x90))
+
+#define FIO0MASK1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x11))
+#define FIO1MASK1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x21))
+#define FIO2MASK1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x51))
+#define FIO3MASK1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x71))
+#define FIO4MASK1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x91))
+
+#define FIO0MASK2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x12))
+#define FIO1MASK2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x32))
+#define FIO2MASK2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x52))
+#define FIO3MASK2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x72))
+#define FIO4MASK2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x92))
+
+#define FIO0MASK3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x13))
+#define FIO1MASK3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x33))
+#define FIO2MASK3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x53))
+#define FIO3MASK3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x73))
+#define FIO4MASK3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x93))
+
+#define FIO0MASKL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x10))
+#define FIO1MASKL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x30))
+#define FIO2MASKL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x50))
+#define FIO3MASKL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x70))
+#define FIO4MASKL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x90))
+
+#define FIO0MASKU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x12))
+#define FIO1MASKU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x32))
+#define FIO2MASKU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x52))
+#define FIO3MASKU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x72))
+#define FIO4MASKU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x92))
+
+#define FIO0PIN0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x14))
+#define FIO1PIN0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x34))
+#define FIO2PIN0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x54))
+#define FIO3PIN0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x74))
+#define FIO4PIN0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x94))
+
+#define FIO0PIN1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x15))
+#define FIO1PIN1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x25))
+#define FIO2PIN1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x55))
+#define FIO3PIN1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x75))
+#define FIO4PIN1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x95))
+
+#define FIO0PIN2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x16))
+#define FIO1PIN2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x36))
+#define FIO2PIN2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x56))
+#define FIO3PIN2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x76))
+#define FIO4PIN2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x96))
+
+#define FIO0PIN3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x17))
+#define FIO1PIN3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x37))
+#define FIO2PIN3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x57))
+#define FIO3PIN3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x77))
+#define FIO4PIN3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x97))
+
+#define FIO0PINL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x14))
+#define FIO1PINL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x34))
+#define FIO2PINL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x54))
+#define FIO3PINL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x74))
+#define FIO4PINL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x94))
+
+#define FIO0PINU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x16))
+#define FIO1PINU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x36))
+#define FIO2PINU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x56))
+#define FIO3PINU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x76))
+#define FIO4PINU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x96))
+
+#define FIO0SET0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x18))
+#define FIO1SET0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x38))
+#define FIO2SET0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x58))
+#define FIO3SET0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x78))
+#define FIO4SET0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x98))
+
+#define FIO0SET1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x19))
+#define FIO1SET1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x29))
+#define FIO2SET1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x59))
+#define FIO3SET1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x79))
+#define FIO4SET1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x99))
+
+#define FIO0SET2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1A))
+#define FIO1SET2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x3A))
+#define FIO2SET2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5A))
+#define FIO3SET2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7A))
+#define FIO4SET2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9A))
+
+#define FIO0SET3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1B))
+#define FIO1SET3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x3B))
+#define FIO2SET3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5B))
+#define FIO3SET3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7B))
+#define FIO4SET3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9B))
+
+#define FIO0SETL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x18))
+#define FIO1SETL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x38))
+#define FIO2SETL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x58))
+#define FIO3SETL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x78))
+#define FIO4SETL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x98))
+
+#define FIO0SETU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x1A))
+#define FIO1SETU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x3A))
+#define FIO2SETU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x5A))
+#define FIO3SETU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x7A))
+#define FIO4SETU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x9A))
+
+#define FIO0CLR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1C))
+#define FIO1CLR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x3C))
+#define FIO2CLR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5C))
+#define FIO3CLR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7C))
+#define FIO4CLR0 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9C))
+
+#define FIO0CLR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1D))
+#define FIO1CLR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x2D))
+#define FIO2CLR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5D))
+#define FIO3CLR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7D))
+#define FIO4CLR1 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9D))
+
+#define FIO0CLR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1E))
+#define FIO1CLR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x3E))
+#define FIO2CLR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5E))
+#define FIO3CLR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7E))
+#define FIO4CLR2 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9E))
+
+#define FIO0CLR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x1F))
+#define FIO1CLR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x3F))
+#define FIO2CLR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x5F))
+#define FIO3CLR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x7F))
+#define FIO4CLR3 (*(volatile uint8_t *) (FIO_BASE_ADDR + 0x9F))
+
+#define FIO0CLRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x1C))
+#define FIO1CLRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x3C))
+#define FIO2CLRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x5C))
+#define FIO3CLRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x7C))
+#define FIO4CLRL (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x9C))
+
+#define FIO0CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x1E))
+#define FIO1CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x3E))
+#define FIO2CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x5E))
+#define FIO3CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x7E))
+#define FIO4CLRU (*(volatile uint16_t *) (FIO_BASE_ADDR + 0x9E))
/* System Control Block(SCB) modules include Memory Accelerator Module,
-Phase Locked Loop, VPB divider, Power Control, External Interrupt,
+Phase Locked Loop, VPB divider, Power Control, External Interrupt,
Reset, and Code Security/Debugging */
#define SCB_BASE_ADDR 0xE01FC000
@@ -415,7 +415,7 @@ Reset, and Code Security/Debugging */
#define CLKSRCSEL (*(volatile uint32_t *) (SCB_BASE_ADDR + 0x10C))
#define PCLKSEL0 (*(volatile uint32_t *) (SCB_BASE_ADDR + 0x1A8))
#define PCLKSEL1 (*(volatile uint32_t *) (SCB_BASE_ADDR + 0x1AC))
-
+
/* External Interrupts */
#define EXTINT (*(volatile uint32_t *) (SCB_BASE_ADDR + 0x140))
#define INTWAKE (*(volatile uint32_t *) (SCB_BASE_ADDR + 0x144))
@@ -433,7 +433,7 @@ Reset, and Code Security/Debugging */
#define AHBCFG2 (*(volatile uint32_t *) (SCB_BASE_ADDR + 0x18C))
/* System Controls and Status */
-#define SCS (*(volatile uint32_t *) (SCB_BASE_ADDR + 0x1A0))
+#define SCS (*(volatile uint32_t *) (SCB_BASE_ADDR + 0x1A0))
/* External Memory Controller (EMC) */
@@ -506,7 +506,7 @@ Reset, and Code Security/Debugging */
#define EMC_STA_EXT_WAIT (*(volatile uint32_t *) (EMC_BASE_ADDR + 0x880))
-
+
/* Timer 0 */
#define TMR0_BASE_ADDR 0xE0004000
#define T0IR (*(volatile uint32_t *) (TMR0_BASE_ADDR + 0x00))
@@ -835,72 +835,72 @@ Reset, and Code Security/Debugging */
/* CAN CONTROLLERS AND ACCEPTANCE FILTER */
#define CAN_ACCEPT_BASE_ADDR 0xE003C000
-#define CAN_AFMR (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x00))
-#define CAN_SFF_SA (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x04))
+#define CAN_AFMR (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x00))
+#define CAN_SFF_SA (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x04))
#define CAN_SFF_GRP_SA (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x08))
#define CAN_EFF_SA (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x0C))
-#define CAN_EFF_GRP_SA (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x10))
+#define CAN_EFF_GRP_SA (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x10))
#define CAN_EOT (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x14))
-#define CAN_LUT_ERR_ADR (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x18))
+#define CAN_LUT_ERR_ADR (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x18))
#define CAN_LUT_ERR (*(volatile uint32_t *) (CAN_ACCEPT_BASE_ADDR + 0x1C))
-#define CAN_CENTRAL_BASE_ADDR 0xE0040000
-#define CAN_TX_SR (*(volatile uint32_t *) (CAN_CENTRAL_BASE_ADDR + 0x00))
-#define CAN_RX_SR (*(volatile uint32_t *) (CAN_CENTRAL_BASE_ADDR + 0x04))
+#define CAN_CENTRAL_BASE_ADDR 0xE0040000
+#define CAN_TX_SR (*(volatile uint32_t *) (CAN_CENTRAL_BASE_ADDR + 0x00))
+#define CAN_RX_SR (*(volatile uint32_t *) (CAN_CENTRAL_BASE_ADDR + 0x04))
#define CAN_MSR (*(volatile uint32_t *) (CAN_CENTRAL_BASE_ADDR + 0x08))
#define CAN1_BASE_ADDR 0xE0044000
-#define CAN1MOD (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x00))
-#define CAN1CMR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x04))
-#define CAN1GSR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x08))
-#define CAN1ICR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x0C))
+#define CAN1MOD (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x00))
+#define CAN1CMR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x04))
+#define CAN1GSR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x08))
+#define CAN1ICR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x0C))
#define CAN1IER (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x10))
-#define CAN1BTR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x14))
-#define CAN1EWL (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x18))
-#define CAN1SR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x1C))
-#define CAN1RFS (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x20))
+#define CAN1BTR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x14))
+#define CAN1EWL (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x18))
+#define CAN1SR (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x1C))
+#define CAN1RFS (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x20))
#define CAN1RID (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x24))
-#define CAN1RDA (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x28))
+#define CAN1RDA (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x28))
#define CAN1RDB (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x2C))
-
-#define CAN1TFI1 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x30))
-#define CAN1TID1 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x34))
+
+#define CAN1TFI1 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x30))
+#define CAN1TID1 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x34))
#define CAN1TDA1 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x38))
-#define CAN1TDB1 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x3C))
-#define CAN1TFI2 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x40))
-#define CAN1TID2 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x44))
-#define CAN1TDA2 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x48))
+#define CAN1TDB1 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x3C))
+#define CAN1TFI2 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x40))
+#define CAN1TID2 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x44))
+#define CAN1TDA2 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x48))
#define CAN1TDB2 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x4C))
-#define CAN1TFI3 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x50))
-#define CAN1TID3 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x54))
-#define CAN1TDA3 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x58))
+#define CAN1TFI3 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x50))
+#define CAN1TID3 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x54))
+#define CAN1TDA3 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x58))
#define CAN1TDB3 (*(volatile uint32_t *) (CAN1_BASE_ADDR + 0x5C))
#define CAN2_BASE_ADDR 0xE0048000
-#define CAN2MOD (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x00))
-#define CAN2CMR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x04))
-#define CAN2GSR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x08))
-#define CAN2ICR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x0C))
+#define CAN2MOD (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x00))
+#define CAN2CMR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x04))
+#define CAN2GSR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x08))
+#define CAN2ICR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x0C))
#define CAN2IER (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x10))
-#define CAN2BTR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x14))
-#define CAN2EWL (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x18))
-#define CAN2SR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x1C))
-#define CAN2RFS (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x20))
+#define CAN2BTR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x14))
+#define CAN2EWL (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x18))
+#define CAN2SR (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x1C))
+#define CAN2RFS (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x20))
#define CAN2RID (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x24))
-#define CAN2RDA (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x28))
+#define CAN2RDA (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x28))
#define CAN2RDB (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x2C))
-
-#define CAN2TFI1 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x30))
-#define CAN2TID1 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x34))
+
+#define CAN2TFI1 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x30))
+#define CAN2TID1 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x34))
#define CAN2TDA1 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x38))
-#define CAN2TDB1 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x3C))
-#define CAN2TFI2 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x40))
-#define CAN2TID2 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x44))
-#define CAN2TDA2 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x48))
+#define CAN2TDB1 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x3C))
+#define CAN2TFI2 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x40))
+#define CAN2TID2 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x44))
+#define CAN2TDA2 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x48))
#define CAN2TDB2 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x4C))
-#define CAN2TFI3 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x50))
-#define CAN2TID3 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x54))
-#define CAN2TDA3 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x58))
+#define CAN2TFI3 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x50))
+#define CAN2TID3 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x54))
+#define CAN2TDA3 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x58))
#define CAN2TDB3 (*(volatile uint32_t *) (CAN2_BASE_ADDR + 0x5C))
@@ -1136,9 +1136,9 @@ Reset, and Code Security/Debugging */
#define MAC_POWERDOWN (*(volatile uint32_t *) (MAC_BASE_ADDR + 0xFF4)) /* Power-down reg */
#define MAC_MODULEID (*(volatile uint32_t *) (MAC_BASE_ADDR + 0xFFC)) /* Module ID reg (RO) */
-/* LCD Controller */
+/* LCD Controller */
-#define LCD_BASE_ADDR 0xFFE10000
+#define LCD_BASE_ADDR 0xFFE10000
#define LCD_CFG (*(volatile uint32_t *) 0xE01FC1B8)
#define LCD_TIMH (*(volatile uint32_t *) (LCD_BASE_ADDR + 0x000))
#define LCD_TIMV (*(volatile uint32_t *) (LCD_BASE_ADDR + 0x004))
diff --git a/c/src/lib/libbsp/arm/lpc24xx/misc/dma.c b/c/src/lib/libbsp/arm/lpc24xx/misc/dma.c
index c42768f4fc..1f3f896d43 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/misc/dma.c
+++ b/c/src/lib/libbsp/arm/lpc24xx/misc/dma.c
@@ -82,17 +82,17 @@ void lpc24xx_dma_channel_disable(unsigned channel, bool force)
if (channel < GPDMA_CH_NUMBER) {
volatile lpc24xx_dma_channel *ch = GPDMA_CH_BASE_ADDR(channel);
uint32_t cfg = ch->cfg;
-
+
if (!force) {
/* Halt */
ch->cfg = SET_FLAG(cfg, GPDMA_CH_CFG_HALT);
-
+
/* Wait for inactive */
do {
cfg = ch->cfg;
} while (IS_FLAG_SET(cfg, GPDMA_CH_CFG_ACTIVE));
}
-
+
/* Disable */
ch->cfg = CLEAR_FLAG(cfg, GPDMA_CH_CFG_EN);
}
diff --git a/c/src/lib/libbsp/arm/lpc24xx/misc/io.c b/c/src/lib/libbsp/arm/lpc24xx/misc/io.c
index 2ca27fc509..6526bf8b7c 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/misc/io.c
+++ b/c/src/lib/libbsp/arm/lpc24xx/misc/io.c
@@ -223,7 +223,7 @@ rtems_status_code lpc24xx_gpio_config(
/* Resistor */
LPC24XX_PINMODE [select] =
(LPC24XX_PINMODE [select] & ~(LPC24XX_IO_SELECT_MASK << shift))
- | ((resistor & LPC24XX_IO_SELECT_MASK) << shift);
+ | ((resistor & LPC24XX_IO_SELECT_MASK) << shift);
rtems_interrupt_flash(level);
diff --git a/c/src/lib/libbsp/arm/lpc24xx/network/network.c b/c/src/lib/libbsp/arm/lpc24xx/network/network.c
index 2bb9b58831..43a73a1240 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/network/network.c
+++ b/c/src/lib/libbsp/arm/lpc24xx/network/network.c
@@ -398,7 +398,7 @@ static void lpc24xx_eth_receive_task(void *arg)
volatile lpc24xx_eth_transfer_descriptor *const desc =
(volatile lpc24xx_eth_transfer_descriptor *)
LPC24XX_ETH_RECEIVE_DESC_START;
- volatile lpc24xx_eth_receive_info *const info =
+ volatile lpc24xx_eth_receive_info *const info =
(volatile lpc24xx_eth_receive_info *)
LPC24XX_ETH_RECEIVE_INFO_START;
struct mbuf **const mbuf_table =
@@ -416,7 +416,7 @@ static void lpc24xx_eth_receive_task(void *arg)
/* Wait for events */
sc = rtems_bsdnet_event_receive(
- LPC24XX_ETH_EVENT_INITIALIZE | LPC24XX_ETH_EVENT_INTERRUPT,
+ LPC24XX_ETH_EVENT_INITIALIZE | LPC24XX_ETH_EVENT_INTERRUPT,
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
&events
@@ -695,7 +695,7 @@ static void lpc24xx_eth_transmit_task(void *arg)
/* Wait for events */
sc = rtems_bsdnet_event_receive(
LPC24XX_ETH_EVENT_INITIALIZE
- | LPC24XX_ETH_EVENT_START
+ | LPC24XX_ETH_EVENT_START
| LPC24XX_ETH_EVENT_INTERRUPT,
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
@@ -950,8 +950,8 @@ static void lpc24xx_eth_interface_init(void *arg)
/* Start receive task */
if (e->receive_task == RTEMS_ID_NONE) {
e->receive_task = rtems_bsdnet_newproc(
- "ntrx",
- 4096,
+ "ntrx",
+ 4096,
lpc24xx_eth_receive_task,
e
);
@@ -962,8 +962,8 @@ static void lpc24xx_eth_interface_init(void *arg)
/* Start transmit task */
if (e->transmit_task == RTEMS_ID_NONE) {
e->transmit_task = rtems_bsdnet_newproc(
- "nttx",
- 4096,
+ "nttx",
+ 4096,
lpc24xx_eth_transmit_task,
e
);
diff --git a/c/src/lib/libbsp/arm/lpc24xx/startup/bspstarthooks.c b/c/src/lib/libbsp/arm/lpc24xx/startup/bspstarthooks.c
index c86cd02171..1c899a00ad 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/startup/bspstarthooks.c
+++ b/c/src/lib/libbsp/arm/lpc24xx/startup/bspstarthooks.c
@@ -145,89 +145,89 @@ static void __attribute__((section(".bsp_start"))) lpc24xx_init_emc_1(void)
*/
/* Global dynamic settings */
-
+
/* FIXME */
EMC_DYN_APR = 2;
-
+
/* Data-in to active command period tWR + tRP */
EMC_DYN_DAL = 4;
-
+
/* Load mode register to active or refresh command period 2 tCK */
EMC_DYN_MRD = 1;
-
+
/* Active to precharge command period 44 ns */
EMC_DYN_RAS = 3;
-
+
/* Active to active command period 66 ns */
EMC_DYN_RC = 4;
-
+
/* Use command delayed strategy */
EMC_DYN_RD_CFG = 1;
-
+
/* Auto refresh period 66 ns */
EMC_DYN_RFC = 4;
-
+
/* Precharge command period 20 ns */
EMC_DYN_RP = 1;
-
+
/* Active bank a to active bank b command period 15 ns */
EMC_DYN_RRD = 1;
-
+
/* FIXME */
EMC_DYN_SREX = 5;
-
+
/* Write recovery time 15 ns */
EMC_DYN_WR = 1;
-
+
/* Exit self refresh to active command period 75 ns */
EMC_DYN_XSR = 5;
-
+
/* Dynamic Memory 0: Micron M T48LC 4M16 A2 P 75 IT */
-
+
/*
* Use SDRAM, 0 0 001 01 address mapping, disabled buffer, unprotected writes
*/
EMC_DYN_CFG0 = 0x0280;
-
+
/* CAS and RAS latency */
EMC_DYN_RASCAS0 = 0x0202;
-
+
/* Wait 50 micro seconds */
lpc24xx_cpu_delay(3600);
-
+
/* Send command: NOP */
EMC_DYN_CTRL = EMC_DYN_CTRL_CE | EMC_DYN_CTRL_CS | EMC_DYN_CTRL_CMD_NOP;
-
+
/* Wait 50 micro seconds */
lpc24xx_cpu_delay(3600);
-
+
/* Send command: PRECHARGE ALL */
EMC_DYN_CTRL = EMC_DYN_CTRL_CE | EMC_DYN_CTRL_CS | EMC_DYN_CTRL_CMD_PALL;
-
+
/* Shortest possible refresh period */
EMC_DYN_RFSH = 0x01;
-
+
/* Wait at least 128 AHB clock cycles */
lpc24xx_cpu_delay(128);
-
+
/* Wait 1 micro second */
lpc24xx_cpu_delay(72);
-
+
/* Set refresh period */
EMC_DYN_RFSH = 0x46;
-
+
/* Send command: MODE */
EMC_DYN_CTRL = EMC_DYN_CTRL_CE | EMC_DYN_CTRL_CS | EMC_DYN_CTRL_CMD_MODE;
-
+
/* Set mode register in SDRAM */
*((volatile uint32_t *) (0xa0000000 | (0x23 << (1 + 2 + 8))));
-
+
/* Send command: NORMAL */
EMC_DYN_CTRL = 0;
-
+
/* Enable buffer */
EMC_DYN_CFG0 |= 0x00080000;
-
+
/* Test RAM */
lpc24xx_ram_test_32();
}
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm7/source/wifi_arm7.c b/c/src/lib/libbsp/arm/nds/dswifi/arm7/source/wifi_arm7.c
index 342ac9017b..f29f4c6eaf 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm7/source/wifi_arm7.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm7/source/wifi_arm7.c
@@ -1,7 +1,7 @@
// DS Wifi interface code
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
// wifi_arm7.c - arm7 wifi interface code
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -67,7 +67,7 @@ void InitFlashData() {
int ReadFlashByte(int address) {
if(address<0 || address>511) return 0;
- return FlashData[address];
+ return FlashData[address];
}
int ReadFlashBytes(int address, int numbytes) {
@@ -546,7 +546,7 @@ void Wifi_Intr_RxEnd() {
WifiData->stats[WSTAT_RXBYTES]+=full_packetlen;
WifiData->stats[WSTAT_RXDATABYTES]+=full_packetlen-12;
-
+
// process packet here
temp=Wifi_ProcessReceivedFrame(base,full_packetlen); // returns packet type
if(temp&WifiData->reqPacketFlags || WifiData->reqReqFlags&WFLAG_REQ_PROMISC) { // if packet type is requested, forward it to the rx queue
@@ -635,7 +635,7 @@ void Wifi_Interrupt() {
if(wIF& 0x0020) { W_IF=0x0020; Wifi_Intr_CntOverflow(); } // 5) AckCount Overflow
if(wIF& 0x0040) { W_IF=0x0040; Wifi_Intr_DoNothing(); } // 6) Start Rx
if(wIF& 0x0080) { W_IF=0x0080; Wifi_Intr_StartTx(); } // 7) Start Tx
- if(wIF& 0x0100) { W_IF=0x0100; Wifi_Intr_DoNothing(); } // 8)
+ if(wIF& 0x0100) { W_IF=0x0100; Wifi_Intr_DoNothing(); } // 8)
if(wIF& 0x0200) { W_IF=0x0200; Wifi_Intr_DoNothing(); } // 9)
if(wIF& 0x0400) { W_IF=0x0400; Wifi_Intr_DoNothing(); } //10)
if(wIF& 0x0800) { W_IF=0x0800; Wifi_Intr_DoNothing(); } //11) RF Wakeup
@@ -1055,9 +1055,9 @@ void Wifi_SetChannel(int channel) {
Wifi_RFWrite( (ReadFlashByte(n)<<8) | ReadFlashByte(n+channel+1) | 0x050000 );
n+=15;
}
-
+
swiDelay( 12583 ); // 1500 us delay
-
+
break;
default:
break;
@@ -1232,7 +1232,7 @@ int Wifi_SendAssocPacket() { // uses arm7 data in our struct
} else {
((u16 *)(data+i))[0]=0x0021; // CAPS info
}
-
+
((u16 *)(data+i))[1]=WIFI_REG(0x8E); // Listen interval
i+=4;
data[i++]=0; // SSID element
@@ -1247,7 +1247,7 @@ int Wifi_SendAssocPacket() { // uses arm7 data in our struct
for(j=2;j<16;j++) WifiData->baserates7[j]=WifiData->baserates7[j-1];
}
WifiData->baserates7[1]=0x04;
-
+
WifiData->baserates7[15]=0;
for(j=0;j<16;j++) if(WifiData->baserates7[j]==0) break;
numrates=j;
@@ -1500,9 +1500,9 @@ int Wifi_ProcessReceivedFrame(int macbase, int framelen) {
if(WifiData->authlevel==WIFI_AUTHLEVEL_AUTHENTICATED || WifiData->authlevel==WIFI_AUTHLEVEL_DEASSOCIATED) {
WifiData->authlevel=WIFI_AUTHLEVEL_ASSOCIATED;
WifiData->authctr=0;
-
-
+
+
}
} else { // status code = failure!
WifiData->curMode=WIFIMODE_CANNOTASSOCIATE;
@@ -1513,7 +1513,7 @@ int Wifi_ProcessReceivedFrame(int macbase, int framelen) {
return WFLAG_PACKET_MGT;
- case 0x00: // 0000 00 Assoc Request
+ case 0x00: // 0000 00 Assoc Request
case 0x08: // 0010 00 Reassoc Request
case 0x10: // 0100 00 Probe Request
case 0x24: // 1001 00 ATIM
@@ -1547,7 +1547,7 @@ int Wifi_ProcessReceivedFrame(int macbase, int framelen) {
if(((u16 *)(data+24))[2]==0) { // status code: successful
// scrape challenge text and send challenge reply
if(data[24+6]==0x10) { // 16 = challenge text - this value must be 0x10 or else!
- Wifi_SendSharedKeyAuthPacket2(data[24+7],data+24+8);
+ Wifi_SendSharedKeyAuthPacket2(data[24+7],data+24+8);
}
} else { // rejected, just give up.
WifiData->curMode=WIFIMODE_CANNOTASSOCIATE;
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm7/source/wifi_arm7.h b/c/src/lib/libbsp/arm/nds/dswifi/arm7/source/wifi_arm7.h
index 875a956a3f..85714fbb13 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm7/source/wifi_arm7.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm7/source/wifi_arm7.h
@@ -1,7 +1,7 @@
// DS Wifi interface code
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
// wifi_arm7.h - arm7 wifi interface header
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP.c
index d2561b8fc7..fa57f98adb 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP.h
index e9b1a29672..8965fe1ae6 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.c
index 1dd4d72e20..eca655fe78 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -65,7 +65,7 @@ int sgIP_is_broadcast_address(sgIP_Hub_HWInterface * hw, unsigned long ipaddr) {
}
// this function will protect against malformed packets that could cause internal problems.
-int sgIP_ARP_Check_isok(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb, sgIP_Header_ARP * arp) {
+int sgIP_ARP_Check_isok(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb, sgIP_Header_ARP * arp) {
return 1; // doesn't do anything yet ;)
}
@@ -184,7 +184,7 @@ int sgIP_ARP_SendProtocolFrame(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb, un
if(ArpRecords[i].queued_packet) { // if there is already a queued packet, reject the new one.
sgIP_memblock_free(mb);
return 0; // couldn't send.
- } else {
+ } else {
sgIP_memblock_exposeheader(mb,-14); // re-hide ethernet header.
ArpRecords[i].queued_packet=mb; // queue packet.
ArpRecords[i].linked_protocol=protocol; // queue packet.
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.h
index 9c9e9ffd55..eda6e89d32 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ARP.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -65,11 +65,11 @@ extern "C" {
extern int sgIP_ARP_ProcessIPFrame(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb);
extern int sgIP_ARP_ProcessARPFrame(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb);
extern int sgIP_ARP_SendProtocolFrame(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb, unsigned short protocol, unsigned long destaddr);
-
+
extern int sgIP_ARP_SendARPResponse(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb);
extern int sgIP_ARP_SendGratARP(sgIP_Hub_HWInterface * hw);
extern int sgIP_ARP_SendARPRequest(sgIP_Hub_HWInterface * hw, int protocol, unsigned long protocol_addr);
-
+
#ifdef __cplusplus
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Config.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Config.h
index cfcdcf7050..26772b0f40 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Config.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Config.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -33,14 +33,14 @@ SOFTWARE.
// General options - these control the core functionality of the stack.
// SGIP_USEDYNAMICMEMORY: Allows the stack to use memory as it needs it, via malloc()/free()
-// This option is extremely useful in environments where it can be used, as it prevents the
+// This option is extremely useful in environments where it can be used, as it prevents the
// overhead of allocating per-connection memory in advance, and allows an unlimited number
// of connections, provided the memory space. This option requires the implementation of
-// two C functions, "void * sgIP_malloc(int)" and "void sgIP_free(void *)", which behave
+// two C functions, "void * sgIP_malloc(int)" and "void sgIP_free(void *)", which behave
// similarly to the malloc and free functions commonly used in C.
#define SGIP_USEDYNAMICMEMORY
-// SGIP_INTERRUPT_THREADING_MODEL: Provides memory protection in a system that can allow
+// SGIP_INTERRUPT_THREADING_MODEL: Provides memory protection in a system that can allow
// multiple processing "threads" by way of interrupts. This is not required on single
// threaded systems, and not adequate on multithreaded systems, but provides a way to
// allow protection against contention on interrupt-driven systems. This option requires
@@ -52,7 +52,7 @@ SOFTWARE.
// SGIP_MULTITHREADED_THREADING_MODEL: Standard memory protection for large multithreaded
// systems, such as operating systems and the like. This kind of memory protection is
-// useful for true multithreaded systems but useless in a single-threaded system and
+// useful for true multithreaded systems but useless in a single-threaded system and
// harmful in an interrupt-based multiprocess system.
//#define SGIP_MULTITHREADED_THREADING_MODEL
@@ -66,7 +66,7 @@ SOFTWARE.
// received, however, in a memory-tight situation, much smaller values can be used.
#define SGIP_MEMBLOCK_DATASIZE 1600
-// SGIP_MEMBLOCK_BASENUM: The starting number of memblocks that will be allocated. This is
+// SGIP_MEMBLOCK_BASENUM: The starting number of memblocks that will be allocated. This is
// also the total number of memblocks that will be allocated if sgIP is not configured to use
// dynamic memory allocation.
#define SGIP_MEMBLOCK_BASENUM 12
@@ -127,7 +127,7 @@ SOFTWARE.
// (at least on most smaller systems)
#define SGIP_ARP_MAXENTRIES 32
-// SGIP_HUB_MAXHWINTERFACES: The maximum number of hardware interfaces the sgIP hub will
+// SGIP_HUB_MAXHWINTERFACES: The maximum number of hardware interfaces the sgIP hub will
// connect to. A hardware interface being some port (ethernet, wifi, etc) that will relay
// packets to the outside world.
#define SGIP_HUB_MAXHWINTERFACES 1
@@ -198,7 +198,7 @@ SOFTWARE.
#define SGIP_DEBUG_MESSAGE(param) sgIP_dbgprint param
#define SGIP_DEBUG_ERROR(param) sgIP_dbgprint param; while(1);
#else
-#define SGIP_DEBUG_MESSAGE(param)
+#define SGIP_DEBUG_MESSAGE(param)
#define SGIP_DEBUG_ERROR(param)
#endif
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DHCP.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DHCP.c
index 8f6fa6d1ed..33805ba5e4 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DHCP.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DHCP.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -82,7 +82,7 @@ void sgIP_DHCP_BeginDgram(int dgramtype) {
// ensure packet is zero'd.. seems to pacify some routers. malloc doesn't initialise the memory returned.
memset(dhcp_p,0,sizeof(sgIP_DHCP_Packet));
-
+
dhcp_p->op=1; // 1==BOOTREQUEST
dhcp_p->htype=1; // 1== ethernet address type
dhcp_p->hlen=6; // hardware address length
@@ -96,7 +96,7 @@ void sgIP_DHCP_BeginDgram(int dgramtype) {
dhcp_p->giaddr=0;
memcpy(dhcp_p->chaddr,dhcp_int->hwaddr,6);
-
+
dhcp_optionptr=0;
dhcp_p->options[dhcp_optionptr++]=0x63;
dhcp_p->options[dhcp_optionptr++]=0x82;
@@ -143,7 +143,7 @@ void sgIP_DHCP_BeginDgram(int dgramtype) {
dhcp_p->options[dhcp_optionptr++]=0x3C; // DHCP Vendor Class ID
dhcp_p->options[dhcp_optionptr++]=strlen(SGIP_DHCP_CLASSNAME);
for(i=0;i<strlen(SGIP_DHCP_CLASSNAME);i++) {
- dhcp_p->options[dhcp_optionptr++]=(SGIP_DHCP_CLASSNAME)[i];
+ dhcp_p->options[dhcp_optionptr++]=(SGIP_DHCP_CLASSNAME)[i];
}
// reason we don't send it immediately is in case the calling code wants to modify some data or add some options.
@@ -177,7 +177,7 @@ void sgIP_DHCP_Start(sgIP_Hub_HWInterface * interface, int getDNS) { // begin dh
bind(dhcp_socket,(struct sockaddr *)&sain,sizeof(sain));
i=1;
ioctl(dhcp_socket,FIONBIO,&i);
-
+
sgIP_DHCP_BeginDgram(DHCP_TYPE_DISCOVER);
sgIP_DHCP_SendDgram();
}
@@ -337,9 +337,9 @@ int gethostname(char *name, size_t len)
if (name == NULL)
return SGIP_ERROR(EFAULT);
- if ( len <= size )
+ if ( len <= size )
return SGIP_ERROR(EINVAL);
-
+
strncpy(name, dhcp_hostname, size);
name[size]=0;
return 0;
@@ -352,12 +352,12 @@ int sethostname(const char *name, size_t len)
int size = sizeof(dhcp_hostname);
if (name == NULL)
return SGIP_ERROR(EFAULT);
-
- if ( len > size - 1)
+
+ if ( len > size - 1)
return SGIP_ERROR(EINVAL);
-
- rec = sgIP_DNS_FindDNSRecord(dhcp_hostname);
-
+
+ rec = sgIP_DNS_FindDNSRecord(dhcp_hostname);
+
strncpy(dhcp_hostname, name, len);
dhcp_hostname[len]=0;
strncpy(rec->aliases[0], name, len);
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DHCP.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DHCP.h
index 505b700b23..ba980af362 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DHCP.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DHCP.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DNS.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DNS.c
index cbc5ac8f6b..432236b205 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DNS.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DNS.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -122,7 +122,7 @@ int sgIP_DNS_isipaddress(const char * name, unsigned long * ipdest) {
if(g[0]>=0x100 || g[1]>=0x1000000) return 0;
out_addr= (g[0]<<24) | g[1];
break;
- case 2:
+ case 2:
if(g[0]>=0x100 || g[1]>=0x100 || g[2]>=0x10000) return 0;
out_addr= (g[0]<<24) | (g[1]<<16) | g[2];
break;
@@ -254,7 +254,7 @@ int sgIP_DNS_genquery(const char * name) {
querydata_s[4]=0; // no nameserver records
querydata_s[5]=0; // no additional records
// question section
-
+
querydata_c+=12;
querydata_s+=6;
j=0;
@@ -338,7 +338,7 @@ sgIP_DNS_Hostent * sgIP_DNS_gethostbyname(const char * name) {
if(dns_sock==-1) {
hw=sgIP_Hub_GetDefaultInterface();
serverip=hw->dns[0];
-
+
dns_sock=socket(AF_INET,SOCK_DGRAM,0);
i=1;
i=ioctl(dns_sock,FIONBIO,&i); // set non-blocking
@@ -398,7 +398,7 @@ dns_listenonly:
return NULL;
}
-
+
resdata_c+=12;
while(q) { // ignore questions
do {
@@ -414,7 +414,7 @@ dns_listenonly:
naddr=0;
rec=sgIP_DNS_GetUnusedRecord();
rec->flags=SGIP_DNS_FLAG_ACTIVE | SGIP_DNS_FLAG_BUSY;
- while(a) {
+ while(a) {
if(nalias<SGIP_DNS_MAXALIASES) sgIP_DNS_CopyAliasAt(rec->aliases[nalias++],resdata_c-responsedata);
do {
j=resdata_c[0];
@@ -473,7 +473,7 @@ unsigned long inet_addr(const char *cp) {
int inet_aton(const char *cp, struct in_addr *inp) {
unsigned long IP;
-
+
if(sgIP_DNS_isipaddress(cp,&IP)) {
inp->s_addr = IP;
return 1;
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DNS.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DNS.h
index 3ccfed11ed..2b23a2cec0 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DNS.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_DNS.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Hub.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Hub.c
index 1b141b7129..e91de87ad4 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Hub.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Hub.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -123,7 +123,7 @@ int sgIP_Hub_ReceiveHardwarePacket(sgIP_Hub_HWInterface * hw, sgIP_memblock * pa
// hide ethernet header for higher-level protocols
sgIP_memblock_exposeheader(packet,-14);
for(n=0;n<SGIP_HUB_MAXPROTOCOLINTERFACES;n++) {
- if(ProtocolInterfaces[n].flags&SGIP_FLAG_PROTOCOL_ENABLED && ProtocolInterfaces[n].protocol==protocol) { // this protocol handler
+ if(ProtocolInterfaces[n].flags&SGIP_FLAG_PROTOCOL_ENABLED && ProtocolInterfaces[n].protocol==protocol) { // this protocol handler
return ProtocolInterfaces[n].ReceivePacket(packet);
}
}
@@ -147,13 +147,13 @@ int sgIP_Hub_SendProtocolPacket(int protocol, sgIP_memblock * packet, unsigned l
// resolve protocol address to hardware address & send packet
if( (src_address & hw->snmask) == (dest_address & hw->snmask) // on same network
|| dest_address == 0xFFFFFFFF ) // or broadcast address, send directly.
- {
+ {
return sgIP_ARP_SendProtocolFrame(hw,packet,protocol,dest_address);
} else { // eek, on different network. Send to gateway
return sgIP_ARP_SendProtocolFrame(hw,packet,protocol,hw->gateway);
}
}
-// send packet on a hardware interface.
+// send packet on a hardware interface.
int sgIP_Hub_SendRawPacket(sgIP_Hub_HWInterface * hw, sgIP_memblock * packet) {
if(!hw || !packet) return 0;
if(hw->flags&SGIP_FLAG_HWINTERFACE_ENABLED) {
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Hub.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Hub.h
index fd1305524f..f8df3a0cea 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Hub.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_Hub.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -69,7 +69,7 @@ typedef struct SGIP_HUB_HWINTERFACE {
typedef struct SGIP_HEADER_ETHERNET {
unsigned char dest_mac[6];
unsigned char src_mac[6];
- unsigned short protocol;
+ unsigned short protocol;
} sgIP_Header_Ethernet;
#define ntohs(num) htons(num)
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ICMP.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ICMP.c
index 57143c5efe..9595d844d3 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ICMP.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ICMP.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ICMP.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ICMP.h
index e934609510..e9513b55ba 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ICMP.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_ICMP.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_IP.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_IP.c
index 595516b4da..d145ba4d92 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_IP.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_IP.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -47,7 +47,7 @@ int sgIP_IP_ReceivePacket(sgIP_memblock * mb) {
SGIP_DEBUG_MESSAGE(("-%i/%i",mb->totallength,htons(iphdr->tot_length)));
sgIP_memblock_free(mb);
return 0; // bad size.
- }
+ }
sgIP_memblock_trimsize(mb,htons(iphdr->tot_length));
// check version
if((iphdr->version_ihl>>4)!=4) {
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_IP.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_IP.h
index 4d579569cf..d6b047429d 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_IP.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_IP.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_TCP.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_TCP.c
index a513735645..92e63ec6ba 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_TCP.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_TCP.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -32,7 +32,7 @@ sgIP_Record_TCP * tcprecords;
int port_counter;
unsigned long lasttime;
extern unsigned long volatile sgIP_timems;
-sgIP_TCP_SYNCookie synlist[SGIP_TCP_MAXSYNS];
+sgIP_TCP_SYNCookie synlist[SGIP_TCP_MAXSYNS];
int numsynlist; // number of active entries in synlist (earliest first)
@@ -54,7 +54,7 @@ void sgIP_TCP_Timer() { // scan through tcp records and resend anything necessar
synlist[i].timebackoff*=2;
if(synlist[i].timebackoff>SGIP_TCP_BACKOFFMAX) synlist[i].timebackoff=SGIP_TCP_BACKOFFMAX;
if(j>synlist[i].timebackoff) synlist[i].timenext=0; else synlist[i].timenext=synlist[i].timebackoff-j;
- // resend SYN
+ // resend SYN
sgIP_TCP_SendSynReply(SGIP_TCP_FLAG_SYN|SGIP_TCP_FLAG_ACK,synlist[i].localseq,synlist[i].remoteseq,synlist[i].localip,synlist[i].remoteip,synlist[i].localport,synlist[i].remoteport,-1);
} else {
synlist[i].timenext-=time;
@@ -82,7 +82,7 @@ void sgIP_TCP_Timer() { // scan through tcp records and resend anything necessar
j=rec->time_backoff;
j*=2;
if(j>SGIP_TCP_BACKOFFMAX) j=SGIP_TCP_BACKOFFMAX;
- sgIP_TCP_SendPacket(rec,SGIP_TCP_FLAG_SYN,0);
+ sgIP_TCP_SendPacket(rec,SGIP_TCP_FLAG_SYN,0);
rec->time_backoff=j; // preserve backoff
}
break;
@@ -100,7 +100,7 @@ void sgIP_TCP_Timer() { // scan through tcp records and resend anything necessar
}
j=rec->buf_tx_out-rec->buf_tx_in;
if(j<0) j+=SGIP_TCP_TRANSMITBUFFERLENGTH;
- j+=(int)(rec->sequence-rec->sequence_next);
+ j+=(int)(rec->sequence-rec->sequence_next);
if(j>0) {// never-sent bytes
if(time>SGIP_TCP_TRANSMIT_DELAY) { // 1000 is an arbitrary constant.
j=rec->buf_tx_out-rec->buf_tx_in;
@@ -182,7 +182,7 @@ void sgIP_TCP_Timer() { // scan through tcp records and resend anything necessar
rec->tcpstate=SGIP_TCP_STATE_CLOSED;
}
break;
- }
+ }
rec=rec->next;
@@ -266,17 +266,17 @@ int sgIP_TCP_ReceivePacket(sgIP_memblock * mb, unsigned long srcip, unsigned lon
if(tcp->tcpflags&SGIP_TCP_FLAG_ACK) {
int i,j;
for(i=0;i<numsynlist;i++) {
- if(synlist[i].localseq+1==tcpack) { // oki! this is probably legit ;)
+ if(synlist[i].localseq+1==tcpack) { // oki! this is probably legit ;)
rec=synlist[i].linked; // we have the data we need.
// remove entry from synlist
numsynlist--;
i*=3;
for(;i<numsynlist;i++) {
synlist[i]=synlist[i+1]; // assume struct copy
- }
+ }
for(j=0;j<rec->maxlisten;j++) if(!rec->listendata[j]) break; // find last entry in listen queue
if(j==rec->maxlisten) { rec=0; break; } // discard this connection! we have no space in the listen queue.
-
+
rec->listendata[j]=sgIP_TCP_AllocRecord();
j++;
if(j!=rec->maxlisten) rec->listendata[j]=0;
@@ -298,7 +298,7 @@ int sgIP_TCP_ReceivePacket(sgIP_memblock * mb, unsigned long srcip, unsigned lon
rec->txwindow=rec->sequence+htons(tcp->window);
sgIP_memblock_free(mb);
- return 0;
+ return 0;
}
}
}
@@ -382,7 +382,7 @@ int sgIP_TCP_ReceivePacket(sgIP_memblock * mb, unsigned long srcip, unsigned lon
delta1=(int)(tcpseq-rec->ack);
if(delta1<0) { // data is partly ack'd...just copy what we need.
datastart-=delta1;
- datalen+=delta1;
+ datalen+=delta1;
}
// copy data into the fifo
rec->ack+=datalen;
@@ -424,7 +424,7 @@ int sgIP_TCP_ReceivePacket(sgIP_memblock * mb, unsigned long srcip, unsigned lon
numsynlist--;
for(delta1=0;delta1<numsynlist;delta1++) {
synlist[delta1]=synlist[delta1+1]; // assume struct copy
- }
+ }
}
{
unsigned long myseq,myport;
@@ -453,7 +453,7 @@ int sgIP_TCP_ReceivePacket(sgIP_memblock * mb, unsigned long srcip, unsigned lon
sgIP_TCP_SendPacket(rec,SGIP_TCP_FLAG_ACK,0);
rec->tcpstate=SGIP_TCP_STATE_ESTABLISHED;
rec->retrycount=0;
- break;
+ break;
case SGIP_TCP_FLAG_SYN: // just got a syn...
rec->ack=tcpseq+1;
rec->sequence=tcpack;
@@ -479,7 +479,7 @@ int sgIP_TCP_ReceivePacket(sgIP_memblock * mb, unsigned long srcip, unsigned lon
rec->tcpstate=SGIP_TCP_STATE_CLOSE_WAIT;
rec->ack=tcpseq+datalen+1;
sgIP_TCP_SendPacket(rec,SGIP_TCP_FLAG_ACK,0);
-
+
}
break;
case SGIP_TCP_STATE_FIN_WAIT_1: // sent a FIN, haven't got FIN or ACK yet.
@@ -819,7 +819,7 @@ int sgIP_TCP_Connect(sgIP_Record_TCP * rec, unsigned long destip, int destport)
rec->srcip=sgIP_IP_GetLocalBindAddr(0,destip);
rec->srcport=htons(sgIP_TCP_GetUnusedOutgoingPort());
rec->destip=destip;
- rec->destport=destport;
+ rec->destport=destport;
} else if(rec->tcpstate==SGIP_TCP_STATE_UNUSED) { // already bound to a local address.
rec->srcip=sgIP_IP_GetLocalBindAddr(rec->srcip,destip);
rec->destip=destip;
@@ -874,14 +874,14 @@ int sgIP_TCP_Send(sgIP_Record_TCP * rec, const char * datatosend, int datalength
}
SGIP_INTR_UNPROTECT();
if(datalength==0) return SGIP_ERROR(EWOULDBLOCK);
- return datalength;
+ return datalength;
}
int sgIP_TCP_Recv(sgIP_Record_TCP * rec, char * databuf, int buflength, int flags) {
if(!rec || !databuf) return SGIP_ERROR(EINVAL); //error
if(rec->buf_rx_in==rec->buf_rx_out) {
if(rec->tcpstate==SGIP_TCP_STATE_CLOSED || rec->tcpstate==SGIP_TCP_STATE_CLOSE_WAIT) {
if(rec->errorcode) return SGIP_ERROR(rec->errorcode);
- return SGIP_ERROR0(ESHUTDOWN);
+ return SGIP_ERROR0(ESHUTDOWN);
}
return SGIP_ERROR(EWOULDBLOCK); //error no data
}
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_TCP.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_TCP.h
index 3c5f8ac8ff..4e4e649b46 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_TCP.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_TCP.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -99,7 +99,7 @@ typedef struct SGIP_TCP_SYNCOOKIE {
unsigned long localseq, remoteseq;
unsigned long localip, remoteip;
unsigned short localport, remoteport;
- unsigned long timenext,timebackoff;
+ unsigned long timenext,timebackoff;
sgIP_Record_TCP * linked; // parent listening connection
} sgIP_TCP_SYNCookie;
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_UDP.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_UDP.c
index 2e3be7fc19..9b4ef807cd 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_UDP.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_UDP.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -204,7 +204,7 @@ int sgIP_UDP_Bind(sgIP_Record_UDP * rec, int srcport, unsigned long srcip) {
int sgIP_UDP_RecvFrom(sgIP_Record_UDP * rec, char * destbuf, int buflength, int flags, unsigned long * sender_ip, unsigned short * sender_port) {
if(!rec || !destbuf || !sender_ip || !sender_port || buflength==0) return SGIP_ERROR(EINVAL);
SGIP_INTR_PROTECT();
- if(rec->incoming_queue==0) {
+ if(rec->incoming_queue==0) {
SGIP_INTR_UNPROTECT();
return SGIP_ERROR(EWOULDBLOCK);
}
@@ -234,7 +234,7 @@ int sgIP_UDP_RecvFrom(sgIP_Record_UDP * rec, char * destbuf, int buflength, int
sgIP_memblock_free(mb);
}
if(!(rec->incoming_queue)) rec->incoming_queue_end=0;
-
+
SGIP_INTR_UNPROTECT();
return buf_start;
}
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_UDP.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_UDP.h
index ea90adbca2..676cd7b6d4 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_UDP.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_UDP.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -50,7 +50,7 @@ typedef struct SGIP_RECORD_UDP {
unsigned long srcip;
unsigned long destip;
unsigned short srcport,destport;
-
+
sgIP_memblock * incoming_queue;
sgIP_memblock * incoming_queue_end;
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_memblock.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_memblock.c
index 474b9f2192..b68918033b 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_memblock.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_memblock.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_memblock.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_memblock.h
index dfbf1bcbb5..85d6011364 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_memblock.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_memblock.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_sockets.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_sockets.c
index 026dbd2d25..e75ee42cf4 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_sockets.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_sockets.c
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -82,7 +82,7 @@ int socket(int domain, int type, int protocol) {
socketlist[s].conn_ptr=sgIP_TCP_AllocRecord();
} else if(type==SOCK_DGRAM) {
socketlist[s].flags=SGIP_SOCKET_FLAG_ACTIVE | SGIP_SOCKET_FLAG_TYPE_UDP;
- socketlist[s].conn_ptr=sgIP_UDP_AllocRecord();
+ socketlist[s].conn_ptr=sgIP_UDP_AllocRecord();
} else {
SGIP_INTR_UNPROTECT();
return SGIP_ERROR(EINVAL);
@@ -138,7 +138,7 @@ int connect(int socket, const struct sockaddr * addr, int addr_len) {
do {
i=((sgIP_Record_TCP *)socketlist[socket].conn_ptr)->tcpstate;
if(i==SGIP_TCP_STATE_ESTABLISHED || i==SGIP_TCP_STATE_CLOSE_WAIT) {retval=0; break;}
- if(i==SGIP_TCP_STATE_CLOSED || i==SGIP_TCP_STATE_UNUSED || i==SGIP_TCP_STATE_LISTEN || i==SGIP_TCP_STATE_NODATA)
+ if(i==SGIP_TCP_STATE_CLOSED || i==SGIP_TCP_STATE_UNUSED || i==SGIP_TCP_STATE_LISTEN || i==SGIP_TCP_STATE_NODATA)
{ retval=SGIP_ERROR(((sgIP_Record_TCP *)socketlist[socket].conn_ptr)->errorcode); break; }
if(socketlist[socket].flags&SGIP_SOCKET_FLAG_NONBLOCKING) break;
SGIP_INTR_UNPROTECT();
@@ -316,7 +316,7 @@ int ioctl(int socket, long cmd, void * arg) {
int setsockopt(int socket, int level, int option_name, const void * data, int data_len) {
return 0;
-}
+}
int getsockopt(int socket, int level, int option_name, void * data, int * data_len) {
return 0;
}
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_sockets.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_sockets.h
index 8ec6055b44..a48e2dc467 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_sockets.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/sgIP_sockets.h
@@ -1,6 +1,6 @@
// DSWifi Project - sgIP Internet Protocol Stack Implementation
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/wifi_arm9.c b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/wifi_arm9.c
index 5ec5a4a6af..a21b659e4e 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/wifi_arm9.c
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/wifi_arm9.c
@@ -1,7 +1,7 @@
// DS Wifi interface code
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
// wifi_arm9.c - arm9 wifi support code
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -166,7 +166,7 @@ void * wHeapAlloc(int size) {
}
}
#endif
- return voidptr;
+ return voidptr;
}
void wHeapFree(void * data) {
@@ -477,7 +477,7 @@ int Wifi_ConnectAP(Wifi_AccessPoint * apdata, int wepmode, int wepkeyid, u8 * we
WifiData->reqReqFlags |= WFLAG_REQ_APCONNECT | WFLAG_REQ_APCOPYVALUES;
wifi_connect_state=1;
} else {
- WifiData->reqMode=WIFIMODE_SCAN;
+ WifiData->reqMode=WIFIMODE_SCAN;
wifi_connect_point = *apdata;
}
return 0;
@@ -487,7 +487,7 @@ void Wifi_AutoConnect(void) {
wifi_connect_state=ASSOCSTATUS_CANNOTCONNECT;
} else {
wifi_connect_state=4;
- WifiData->reqMode=WIFIMODE_SCAN;
+ WifiData->reqMode=WIFIMODE_SCAN;
}
}
@@ -498,7 +498,7 @@ void sgIP_DNS_Record_Localhost(void)
const unsigned char * resdata_c = (unsigned char *)&(wifi_hw->ipaddr);
rec = sgIP_DNS_GetUnusedRecord();
rec->flags=SGIP_DNS_FLAG_ACTIVE | SGIP_DNS_FLAG_BUSY;
-
+
rec->addrlen = 4;
rec->numalias = 1;
gethostname(rec->aliases[0], 256);
@@ -519,7 +519,7 @@ int Wifi_AssocStatus() {
case -1: // error
return ASSOCSTATUS_CANNOTCONNECT;
case 0: // searching
- {
+ {
int i;
Wifi_AccessPoint ap;
i=Wifi_FindMatchingAP(1,&wifi_connect_point,&ap);
@@ -611,7 +611,7 @@ int Wifi_AssocStatus() {
}
}
}
-#else
+#else
// should never get here (dhcp state) without sgIP!
Wifi_DisconnectAP();
wifi_connect_state=-1;
@@ -692,7 +692,7 @@ int Wifi_TransmitFunction(sgIP_Hub_HWInterface * hw, sgIP_memblock * mb) {
sgIP_memblock_free(mb);
return 0; //?
}
-
+
ethhdr_print('T',mb->datastart);
framehdr[0]=0;
framehdr[1]=0;
@@ -803,22 +803,22 @@ unsigned long Wifi_Init(int initflags) {
case WIFIINIT_OPTION_USEHEAP_128:
wHeapAllocInit(128*1024);
break;
- case WIFIINIT_OPTION_USEHEAP_64:
+ case WIFIINIT_OPTION_USEHEAP_64:
wHeapAllocInit(64*1024);
break;
- case WIFIINIT_OPTION_USEHEAP_256:
+ case WIFIINIT_OPTION_USEHEAP_256:
wHeapAllocInit(256*1024);
break;
- case WIFIINIT_OPTION_USEHEAP_512:
+ case WIFIINIT_OPTION_USEHEAP_512:
wHeapAllocInit(512*1024);
break;
case WIFIINIT_OPTION_USECUSTOMALLOC:
break;
}
sgIP_Init();
-
+
#endif
-
+
WifiData->flags9 = WFLAG_ARM9_ACTIVE | (initflags & WFLAG_ARM9_INITFLAGMASK) ;
return (u32) &Wifi_Data_Struct;
}
@@ -874,7 +874,7 @@ void Wifi_Update() {
// destination matches our mac address, or the broadcast address.
//if(framehdr[6]&0x4000) { // wep enabled (when receiving WEP packets, the IV is stripped for us! how nice :|
// base2+=24; hdrlen=28; // base2+=[wifi hdr 12byte]+[802 header hdrlen]+[slip hdr 8byte]
- //} else {
+ //} else {
base2+=22; hdrlen=24;
//}
// SGIP_DEBUG_MESSAGE(("%04X %04X %04X %04X %04X",Wifi_RxReadOffset(base2-8,0),Wifi_RxReadOffset(base2-7,0),Wifi_RxReadOffset(base2-6,0),Wifi_RxReadOffset(base2-5,0),Wifi_RxReadOffset(base2-4,0)));
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/wifi_arm9.h b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/wifi_arm9.h
index e8f351d07c..3b354636cd 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/wifi_arm9.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/arm9/source/wifi_arm9.h
@@ -1,7 +1,7 @@
// DS Wifi interface code
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
// wifi_arm9.c - arm9 wifi support header
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/common/source/dsregs.h b/c/src/lib/libbsp/arm/nds/dswifi/common/source/dsregs.h
index 4faf61e525..3d4c489a85 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/common/source/dsregs.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/common/source/dsregs.h
@@ -2,7 +2,7 @@
// DSRegs.h - (c) 2005-2006 Stephen Stair
// General reference mumbo jumbo to give me easy access to the regs I like.
//////////////////////////////////////////////////////////////////////////
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -135,7 +135,7 @@ SOFTWARE.
if((bank)&1) { VRAMBANKCNT[(bank)>>1] = (VRAMBANKCNT[(bank)>>1]&0x00ff) | (((set)&0xff)<<8); } else \
{ VRAMBANKCNT[(bank)>>1] = (VRAMBANKCNT[(bank)>>1]&0xff00) | ((set)&0xff); }
-// joypad input
+// joypad input
#define KEYINPUT (*((u16 volatile *) 0x04000130))
#define KEYCNT (*((u16 volatile *) 0x04000132))
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/common/source/spinlock.S b/c/src/lib/libbsp/arm/nds/dswifi/common/source/spinlock.S
index e2f36ef81e..024230337c 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/common/source/spinlock.S
+++ b/c/src/lib/libbsp/arm/nds/dswifi/common/source/spinlock.S
@@ -4,36 +4,36 @@
.code 32
-.GLOBL SLasm_Acquire, SLasm_Release
-.ARM
-SLasm_Acquire:
- ldr r2,[r0]
- cmp r2,#0
- movne r0,#1
- bxne lr
- mov r2,r1
- swp r2,r2,[r0]
- cmp r2,#0
- cmpne r2,r1
- moveq r0,#0
- bxeq lr
- swp r2,r2,[r0]
- mov r0,#1
- bx lr
-
-
-
-SLasm_Release:
- ldr r2,[r0]
- cmp r2,r1
- movne r0,#2
- bxne lr
- mov r2,#0
- swp r2,r2,[r0]
- cmp r2,r1
- moveq r0,#0
- movne r0,#2
- bx lr
+.GLOBL SLasm_Acquire, SLasm_Release
+.ARM
+SLasm_Acquire:
+ ldr r2,[r0]
+ cmp r2,#0
+ movne r0,#1
+ bxne lr
+ mov r2,r1
+ swp r2,r2,[r0]
+ cmp r2,#0
+ cmpne r2,r1
+ moveq r0,#0
+ bxeq lr
+ swp r2,r2,[r0]
+ mov r0,#1
+ bx lr
+
+
+
+SLasm_Release:
+ ldr r2,[r0]
+ cmp r2,r1
+ movne r0,#2
+ bxne lr
+ mov r2,#0
+ swp r2,r2,[r0]
+ cmp r2,r1
+ moveq r0,#0
+ movne r0,#2
+ bx lr
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/common/source/spinlock.h b/c/src/lib/libbsp/arm/nds/dswifi/common/source/spinlock.h
index ef89e475b8..773891dbce 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/common/source/spinlock.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/common/source/spinlock.h
@@ -1,7 +1,7 @@
// DS Wifi interface code
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
// spinlock.h - code for spinlocking for basic wifi structure memory protection
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -56,7 +56,7 @@ __asm (
" cmp r2,r1 \n"
" moveq r0,#0 \n"
" movne r0,#2 \n"
-" bx lr \n"
+" bx lr \n"
);
*/
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/common/source/wifi_shared.h b/c/src/lib/libbsp/arm/nds/dswifi/common/source/wifi_shared.h
index 9c83af9502..8656feea6d 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/common/source/wifi_shared.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/common/source/wifi_shared.h
@@ -1,7 +1,7 @@
// DS Wifi interface code
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
// wifi_shared.h - Shared structures to be used by arm9 and arm7
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -35,7 +35,7 @@ SOFTWARE.
// on spinlock contention, the side unsuccessfully attempting the lock reverts the lock.
// if the unlocking side sees the lock incorrectly set, the unlocking side will delay until it has reverted to the correct value, then continue unlocking.
// there should be a delay of at least about ~10-20 cycles between a lock and unlock, to prevent contention.
-#define SPINLOCK_NOBODY 0x0000
+#define SPINLOCK_NOBODY 0x0000
#define SPINLOCK_ARM7 0x0001
#define SPINLOCK_ARM9 0x0002
@@ -143,11 +143,11 @@ enum WIFI_STATS {
WSTAT_ARM7_UPDATES,
WSTAT_DEBUG,
// harware stats (function mostly unknown.)
- WSTAT_HW_1B0,WSTAT_HW_1B1,WSTAT_HW_1B2,WSTAT_HW_1B3,WSTAT_HW_1B4,WSTAT_HW_1B5,WSTAT_HW_1B6,WSTAT_HW_1B7,
- WSTAT_HW_1B8,WSTAT_HW_1B9,WSTAT_HW_1BA,WSTAT_HW_1BB,WSTAT_HW_1BC,WSTAT_HW_1BD,WSTAT_HW_1BE,WSTAT_HW_1BF,
+ WSTAT_HW_1B0,WSTAT_HW_1B1,WSTAT_HW_1B2,WSTAT_HW_1B3,WSTAT_HW_1B4,WSTAT_HW_1B5,WSTAT_HW_1B6,WSTAT_HW_1B7,
+ WSTAT_HW_1B8,WSTAT_HW_1B9,WSTAT_HW_1BA,WSTAT_HW_1BB,WSTAT_HW_1BC,WSTAT_HW_1BD,WSTAT_HW_1BE,WSTAT_HW_1BF,
WSTAT_HW_1C0,WSTAT_HW_1C1,WSTAT_HW_1C4,WSTAT_HW_1C5,
- WSTAT_HW_1D0,WSTAT_HW_1D1,WSTAT_HW_1D2,WSTAT_HW_1D3,WSTAT_HW_1D4,WSTAT_HW_1D5,WSTAT_HW_1D6,WSTAT_HW_1D7,
- WSTAT_HW_1D8,WSTAT_HW_1D9,WSTAT_HW_1DA,WSTAT_HW_1DB,WSTAT_HW_1DC,WSTAT_HW_1DD,WSTAT_HW_1DE,WSTAT_HW_1DF,
+ WSTAT_HW_1D0,WSTAT_HW_1D1,WSTAT_HW_1D2,WSTAT_HW_1D3,WSTAT_HW_1D4,WSTAT_HW_1D5,WSTAT_HW_1D6,WSTAT_HW_1D7,
+ WSTAT_HW_1D8,WSTAT_HW_1D9,WSTAT_HW_1DA,WSTAT_HW_1DB,WSTAT_HW_1DC,WSTAT_HW_1DD,WSTAT_HW_1DE,WSTAT_HW_1DF,
NUM_WIFI_STATS
};
@@ -258,7 +258,7 @@ typedef struct WIFI_MAINSTRUCT {
Wifi_AccessPoint wfc_ap[3];
unsigned long wfc_config[3][5]; // ip, snmask, gateway, primarydns, 2nddns
u8 wfc_wepkey[3][16];
-
+
// wifi data
u32 rxbufIn, rxbufOut; // bufIn/bufOut have 2-byte granularity.
@@ -269,7 +269,7 @@ typedef struct WIFI_MAINSTRUCT {
// stats data
u32 stats[NUM_WIFI_STATS];
-
+
u16 debug[30];
u32 random; // semirandom number updated at the convenience of the arm7. use for initial seeds & such.
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/include/dswifi7.h b/c/src/lib/libbsp/arm/nds/dswifi/include/dswifi7.h
index 0c9e711495..cc8b5322c0 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/include/dswifi7.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/include/dswifi7.h
@@ -1,6 +1,6 @@
// DSWifi Project - Arm7 Library Header file (dswifi7.h)
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -71,7 +71,7 @@ extern void Wifi_Init(unsigned long WifiData);
// called again.
extern void Wifi_Deinit(void);
-// Wifi_Sync: Call this function when requested to sync by the arm9 side of the
+// Wifi_Sync: Call this function when requested to sync by the arm9 side of the
// wifi lib
extern void Wifi_Sync(void);
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/include/dswifi9.h b/c/src/lib/libbsp/arm/nds/dswifi/include/dswifi9.h
index 4b019d3783..9171b48aac 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/include/dswifi9.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/include/dswifi9.h
@@ -1,6 +1,6 @@
// DSWifi Project - Arm9 Library Header File (dswifi9.h)
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
@@ -79,11 +79,11 @@ enum WIFI_STATS {
WSTAT_TXBYTES,
WSTAT_TXDATABYTES,
// harware stats (function mostly unknown.)
- WSTAT_HW_1B0,WSTAT_HW_1B1,WSTAT_HW_1B2,WSTAT_HW_1B3,WSTAT_HW_1B4,WSTAT_HW_1B5,WSTAT_HW_1B6,WSTAT_HW_1B7,
- WSTAT_HW_1B8,WSTAT_HW_1B9,WSTAT_HW_1BA,WSTAT_HW_1BB,WSTAT_HW_1BC,WSTAT_HW_1BD,WSTAT_HW_1BE,WSTAT_HW_1BF,
+ WSTAT_HW_1B0,WSTAT_HW_1B1,WSTAT_HW_1B2,WSTAT_HW_1B3,WSTAT_HW_1B4,WSTAT_HW_1B5,WSTAT_HW_1B6,WSTAT_HW_1B7,
+ WSTAT_HW_1B8,WSTAT_HW_1B9,WSTAT_HW_1BA,WSTAT_HW_1BB,WSTAT_HW_1BC,WSTAT_HW_1BD,WSTAT_HW_1BE,WSTAT_HW_1BF,
WSTAT_HW_1C0,WSTAT_HW_1C1,WSTAT_HW_1C4,WSTAT_HW_1C5,
- WSTAT_HW_1D0,WSTAT_HW_1D1,WSTAT_HW_1D2,WSTAT_HW_1D3,WSTAT_HW_1D4,WSTAT_HW_1D5,WSTAT_HW_1D6,WSTAT_HW_1D7,
- WSTAT_HW_1D8,WSTAT_HW_1D9,WSTAT_HW_1DA,WSTAT_HW_1DB,WSTAT_HW_1DC,WSTAT_HW_1DD,WSTAT_HW_1DE,WSTAT_HW_1DF,
+ WSTAT_HW_1D0,WSTAT_HW_1D1,WSTAT_HW_1D2,WSTAT_HW_1D3,WSTAT_HW_1D4,WSTAT_HW_1D5,WSTAT_HW_1D6,WSTAT_HW_1D7,
+ WSTAT_HW_1D8,WSTAT_HW_1D9,WSTAT_HW_1DA,WSTAT_HW_1DB,WSTAT_HW_1DC,WSTAT_HW_1DD,WSTAT_HW_1DE,WSTAT_HW_1DF,
NUM_WIFI_STATS
};
@@ -202,7 +202,7 @@ extern void Wifi_DisableWifi(void);
// associated to an AP, but actively receiving and potentially transmitting
extern void Wifi_EnableWifi(void);
-// Wifi_SetPromiscuousMode: Allows the DS to enter or leave a "promsicuous" mode, in which
+// Wifi_SetPromiscuousMode: Allows the DS to enter or leave a "promsicuous" mode, in which
// all data that can be received is forwarded to the arm9 for user processing.
// Best used with Wifi_RawSetPacketHandler, to allow user code to use the data
// (well, the lib won't use 'em, so they're just wasting CPU otherwise.)
@@ -218,7 +218,7 @@ extern void Wifi_ScanMode(void);
// int channel: the channel to change to, in the range of 1-13
extern void Wifi_SetChannel(int channel);
-// Wifi_GetNumAP:
+// Wifi_GetNumAP:
// Returns: the current number of APs that are known about and tracked internally
extern int Wifi_GetNumAP(void);
@@ -248,7 +248,7 @@ extern int Wifi_ConnectAP(Wifi_AccessPoint * apdata, int wepmode, int wepkeyid,
extern void Wifi_AutoConnect(void);
// Wifi_AssocStatus: Returns information about the status of connection to an AP
-// Returns: a value from the WIFI_ASSOCSTATUS enum, continue polling until you
+// Returns: a value from the WIFI_ASSOCSTATUS enum, continue polling until you
// receive ASSOCSTATUS_CONNECTED or ASSOCSTATUS_CANNOTCONNECT
extern int Wifi_AssocStatus(void);
@@ -261,7 +261,7 @@ extern int Wifi_DisconnectAP(void);
// int num_ms: The number of milliseconds since the last time this function was called.
extern void Wifi_Timer(int num_ms);
-// Wifi_GetIP:
+// Wifi_GetIP:
// Returns: The current IP address of the DS (may not be valid before connecting to an AP, or setting the IP manually.)
extern unsigned long Wifi_GetIP(void); // get local ip
@@ -270,7 +270,7 @@ extern unsigned long Wifi_GetIP(void); // get local ip
// unsigned long * pSnmask: pointer to receive the currently configured subnet mask
// unsigned long * pDns1: pointer to receive the currently configured primary DNS server IP
// unsigned long * pDns2: pointer to receive the currently configured secondary DNS server IP
-// Returns: The current IP address of the DS
+// Returns: The current IP address of the DS
extern unsigned long Wifi_GetIPInfo(unsigned long * pGateway,unsigned long * pSnmask,unsigned long * pDns1,unsigned long * pDns2);
// Wifi_SetIP: Set the DS's IP address and other IP configuration information.
@@ -297,7 +297,7 @@ extern u32 Wifi_GetStats(int statnum);
// Wifi_RawTxFrame: Send a raw 802.11 frame at a specified rate
// unsigned short datalen: The length in bytes of the frame to send
-// unsigned short rate: The rate to transmit at (Specified as mbits/10, 1mbit=0x000A, 2mbit=0x0014)
+// unsigned short rate: The rate to transmit at (Specified as mbits/10, 1mbit=0x000A, 2mbit=0x0014)
// unsigned short * data: Pointer to the data to send (should be halfword-aligned)
// Returns: Nothing of interest.
extern int Wifi_RawTxFrame(unsigned short datalen, unsigned short rate, unsigned short * data);
@@ -319,7 +319,7 @@ extern int Wifi_RxRawReadPacket(long packetID, long readlength, unsigned short *
// is available.
extern void Wifi_Update(void);
-// Wifi_Sync: Call this function when requested to sync by the arm7 side of the
+// Wifi_Sync: Call this function when requested to sync by the arm7 side of the
// wifi lib
extern void Wifi_Sync(void);
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/include/netdb.h b/c/src/lib/libbsp/arm/nds/dswifi/include/netdb.h
index 3bff579020..914e672db3 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/include/netdb.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/include/netdb.h
@@ -1,6 +1,6 @@
// DSWifi Project - socket emulation layer defines/prototypes (netdb.h)
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/include/netinet/in.h b/c/src/lib/libbsp/arm/nds/dswifi/include/netinet/in.h
index 15e46ccd53..22b960def1 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/include/netinet/in.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/include/netinet/in.h
@@ -1,6 +1,6 @@
// DSWifi Project - socket emulation layer defines/prototypes (netinet/in.h)
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/dswifi/include/sgIP_errno.h b/c/src/lib/libbsp/arm/nds/dswifi/include/sgIP_errno.h
index dcd4deead8..48484d6ae6 100644
--- a/c/src/lib/libbsp/arm/nds/dswifi/include/sgIP_errno.h
+++ b/c/src/lib/libbsp/arm/nds/dswifi/include/sgIP_errno.h
@@ -1,6 +1,6 @@
// DSWifi Project - socket emulation layer defines/prototypes (sgIP_errno.h)
// Copyright (C) 2005-2006 Stephen Stair - sgstair@akkit.org - http://www.akkit.org
-/******************************************************************************
+/******************************************************************************
DSWifi Lib and test materials are licenced under the MIT open source licence:
Copyright (c) 2005-2006 Stephen Stair
diff --git a/c/src/lib/libbsp/arm/nds/fb/fb.c b/c/src/lib/libbsp/arm/nds/fb/fb.c
index 70c8baff13..f41294d332 100644
--- a/c/src/lib/libbsp/arm/nds/fb/fb.c
+++ b/c/src/lib/libbsp/arm/nds/fb/fb.c
@@ -30,7 +30,7 @@
static struct fb_var_screeninfo fb_var_info = {
.xres = SCREEN_WIDTH, /* screen size x, y */
- .yres = SCREEN_HEIGHT,
+ .yres = SCREEN_HEIGHT,
.bits_per_pixel = 16 /* bits per pixel */
};
@@ -48,7 +48,7 @@ static struct fb_fix_screeninfo fb_fix_info = {
static struct fb_var_screeninfo fb_var_info2 = {
.xres = SCREEN_WIDTH, /* screen size x, y */
- .yres = SCREEN_HEIGHT,
+ .yres = SCREEN_HEIGHT,
.bits_per_pixel = 16 /* bits per pixel */
};
diff --git a/c/src/lib/libbsp/arm/nds/libfat/gba/include/fat.h b/c/src/lib/libbsp/arm/nds/libfat/gba/include/fat.h
index 510a298ba8..3fbcce9bed 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/gba/include/fat.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/gba/include/fat.h
@@ -1,9 +1,9 @@
/*
fat.h
Simple functionality for startup, mounting and unmounting of FAT-based devices.
-
+
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -27,10 +27,10 @@
2006-07-11 - Chishm
* Original release
-
+
2006-07-14
* fatInitialise renamed to fatInit
-
+
2006-07-16 - Chishm
* Added fatInitDefault
*/
@@ -90,7 +90,7 @@ bool fatUnsafeUnmount (PARTITION_INTERFACE partitionNumber);
/*
Set the default device for access by fat: and fat0:
-PD_DEFAULT is unallowed.
+PD_DEFAULT is unallowed.
Doesn't do anything useful on GBA, since there is only one device
*/
bool fatSetDefaultInterface (PARTITION_INTERFACE partitionNumber);
diff --git a/c/src/lib/libbsp/arm/nds/libfat/include/fat.h b/c/src/lib/libbsp/arm/nds/libfat/include/fat.h
index ec69082e12..07c02af866 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/include/fat.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/include/fat.h
@@ -1,9 +1,9 @@
/*
fat.h
Simple functionality for startup, mounting and unmounting of FAT-based devices.
-
+
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -27,10 +27,10 @@
2006-07-11 - Chishm
* Original release
-
+
2006-07-14
* fatInitialise renamed to fatInit
-
+
2006-07-16 - Chishm
* Added fatInitDefault
*/
@@ -105,7 +105,7 @@ bool fatUnsafeUnmount (PARTITION_INTERFACE partitionNumber);
/*
Set the default device for access by fat: and fat0:
-PD_DEFAULT is unallowed.
+PD_DEFAULT is unallowed.
Doesn't do anything useful on GBA, since there is only one device
*/
bool fatSetDefaultInterface (PARTITION_INTERFACE partitionNumber);
diff --git a/c/src/lib/libbsp/arm/nds/libfat/nds/include/fat.h b/c/src/lib/libbsp/arm/nds/libfat/nds/include/fat.h
index fad4f6379e..4dde46ddec 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/nds/include/fat.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/nds/include/fat.h
@@ -1,9 +1,9 @@
/*
fat.h
Simple functionality for startup, mounting and unmounting of FAT-based devices.
-
+
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -27,10 +27,10 @@
2006-07-11 - Chishm
* Original release
-
+
2006-07-14
* fatInitialise renamed to fatInit
-
+
2006-07-16 - Chishm
* Added fatInitDefault
*/
@@ -95,7 +95,7 @@ bool fatUnsafeUnmount (PARTITION_INTERFACE partitionNumber);
/*
Set the default device for access by fat: and fat0:
-PD_DEFAULT is unallowed.
+PD_DEFAULT is unallowed.
Doesn't do anything useful on GBA, since there is only one device
*/
bool fatSetDefaultInterface (PARTITION_INTERFACE partitionNumber);
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/bit_ops.h b/c/src/lib/libbsp/arm/nds/libfat/source/bit_ops.h
index f823db7542..1bc0ab7538 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/bit_ops.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/bit_ops.h
@@ -3,7 +3,7 @@
Functions for dealing with conversion of data between types
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/cache.c b/c/src/lib/libbsp/arm/nds/libfat/source/cache.c
index 71e3f8ba12..a1a597c284 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/cache.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/cache.c
@@ -1,16 +1,16 @@
/*
cache.c
- The cache is not visible to the user. It should be flushed
+ The cache is not visible to the user. It should be flushed
when any file is closed or changes are made to the filesystem.
-
- This cache implements a least-used-page replacement policy. This will
- distribute sectors evenly over the pages, so if less than the maximum
+
+ This cache implements a least-used-page replacement policy. This will
+ distribute sectors evenly over the pages, so if less than the maximum
pages are used at once, they should all eventually remain in the cache.
This also has the benefit of throwing out old sectors, so as not to keep
too many stale pages around.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -51,7 +51,7 @@ CACHE* _FAT_cache_constructor (u32 numberOfPages, const IO_INTERFACE* discInterf
if (numberOfPages < 2) {
numberOfPages = 2;
}
-
+
cache = (CACHE*) _FAT_mem_allocate (sizeof(CACHE));
if (cache == NULL) {
return false;
@@ -59,7 +59,7 @@ CACHE* _FAT_cache_constructor (u32 numberOfPages, const IO_INTERFACE* discInterf
cache->disc = discInterface;
cache->numberOfPages = numberOfPages;
-
+
cacheEntries = (CACHE_ENTRY*) _FAT_mem_allocate ( sizeof(CACHE_ENTRY) * numberOfPages);
if (cacheEntries == NULL) {
@@ -163,7 +163,7 @@ bool _FAT_cache_readPartialSector (CACHE* cache, void* buffer, u32 sector, u32 o
return true;
}
-/*
+/*
Writes some data to a cache page, making sure it is loaded into memory first.
*/
bool _FAT_cache_writePartialSector (CACHE* cache, const void* buffer, u32 sector, u32 offset, u32 size) {
@@ -177,14 +177,14 @@ bool _FAT_cache_writePartialSector (CACHE* cache, const void* buffer, u32 sector
if (page == CACHE_FREE) {
return false;
}
-
+
memcpy (cache->pages + (CACHE_PAGE_SIZE * page) + offset, buffer, size);
cache->cacheEntries[page].dirty = true;
return true;
}
-/*
+/*
Writes some data to a cache page, zeroing out the page first
*/
bool _FAT_cache_eraseWritePartialSector (CACHE* cache, const void* buffer, u32 sector, u32 offset, u32 size) {
@@ -198,7 +198,7 @@ bool _FAT_cache_eraseWritePartialSector (CACHE* cache, const void* buffer, u32 s
if (page == CACHE_FREE) {
return false;
}
-
+
memset (cache->pages + (CACHE_PAGE_SIZE * page), 0, CACHE_PAGE_SIZE);
memcpy (cache->pages + (CACHE_PAGE_SIZE * page) + offset, buffer, size);
cache->cacheEntries[page].dirty = true;
@@ -208,7 +208,7 @@ bool _FAT_cache_eraseWritePartialSector (CACHE* cache, const void* buffer, u32 s
/*
-Flushes all dirty pages to disc, clearing the dirty flag.
+Flushes all dirty pages to disc, clearing the dirty flag.
Also resets all pages' page count to 0.
*/
bool _FAT_cache_flush (CACHE* cache) {
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/cache.h b/c/src/lib/libbsp/arm/nds/libfat/source/cache.h
index 3871d2c455..5d08022b1e 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/cache.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/cache.h
@@ -1,16 +1,16 @@
/*
cache.h
- The cache is not visible to the user. It should be flushed
+ The cache is not visible to the user. It should be flushed
when any file is closed or changes are made to the filesystem.
-
- This cache implements a least-used-page replacement policy. This will
- distribute sectors evenly over the pages, so if less than the maximum
+
+ This cache implements a least-used-page replacement policy. This will
+ distribute sectors evenly over the pages, so if less than the maximum
pages are used at once, they should all eventually remain in the cache.
This also has the benefit of throwing out old sectors, so as not to keep
too many stale pages around.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -106,7 +106,7 @@ Write any dirty sectors back to disc and clear out the contents of the cache
*/
bool _FAT_cache_flush (CACHE* cache);
-/*
+/*
Clear out the contents of the cache without writing any dirty sectors first
*/
void _FAT_cache_invalidate (CACHE* cache);
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/common.h b/c/src/lib/libbsp/arm/nds/libfat/source/common.h
index b0cbbad301..0cdfa55b6b 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/common.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/common.h
@@ -3,7 +3,7 @@
Common definitions and included files for the FATlib
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/directory.c b/c/src/lib/libbsp/arm/nds/libfat/source/directory.c
index 7e77ea6d4e..495ca51c57 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/directory.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/directory.c
@@ -4,7 +4,7 @@
a FAT partition
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -25,19 +25,19 @@
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
2006-08-14 - Chishm
* entryFromPath correctly finds "" and "." now
-
+
2006-08-17 - Chishm
* entryFromPath doesn't look for "" anymore - use "." to refer to the current directory
-
- 2006-08-19 - Chishm
+
+ 2006-08-19 - Chishm
* Fixed entryFromPath bug when looking for "." in root directory
-
+
2006-10-01 - Chishm
* Now clears the whole new cluster when linking in more clusters for a directory
-
+
2006-10-28 - Chishm
* stat returns the hostType for the st_dev value
*/
@@ -60,7 +60,7 @@
// Long file name directory entry
enum LFN_offset {
LFN_offset_ordinal = 0x00, // Position within LFN
- LFN_offset_char0 = 0x01,
+ LFN_offset_char0 = 0x01,
LFN_offset_char1 = 0x03,
LFN_offset_char2 = 0x05,
LFN_offset_char3 = 0x07,
@@ -78,7 +78,7 @@ enum LFN_offset {
LFN_offset_char11 = 0x1C,
LFN_offset_char12 = 0x1E
};
-const int LFN_offset_table[13]={0x01,0x03,0x05,0x07,0x09,0x0E,0x10,0x12,0x14,0x16,0x18,0x1C,0x1E};
+const int LFN_offset_table[13]={0x01,0x03,0x05,0x07,0x09,0x0E,0x10,0x12,0x14,0x16,0x18,0x1C,0x1E};
#define LFN_END 0x40
#define LFN_DEL 0x80
@@ -166,7 +166,7 @@ static bool _FAT_directory_entryGetAlias (const u8* entryData, char* destName) {
} else {
destName[1] = '\0';
}
- } else {
+ } else {
// Copy the filename from the dirEntry to the string
for (i = 0; (i < 8) && (entryData[DIR_ENTRY_name + i] != ' '); i++) {
destName[i] = entryData[DIR_ENTRY_name + i];
@@ -214,7 +214,7 @@ static bool _FAT_directory_incrementDirEntryPosition (PARTITION* partition, DIR_
} else {
return false; // Got to the end of the directory, not extending it
}
- }
+ }
position.cluster = tempCluster;
} else if ((position.cluster == FAT16_ROOT_DIR_CLUSTER) && (position.sector == (partition->dataStart - partition->rootDirStart))) {
return false; // Got to end of root directory, can't extend it
@@ -299,7 +299,7 @@ bool _FAT_directory_getNextEntry (PARTITION* partition, DIR_ENTRY* entry) {
chkSum = 0;
for (i=0; i < 11; i++) {
// NOTE: The operation is an unsigned char rotate right
- chkSum = ((chkSum & 1) ? 0x80 : 0) + (chkSum >> 1) + entryData[i];
+ chkSum = ((chkSum & 1) ? 0x80 : 0) + (chkSum >> 1) + entryData[i];
}
if (chkSum != lfnChkSum) {
lfnExists = false;
@@ -340,21 +340,21 @@ bool _FAT_directory_getRootEntry (PARTITION* partition, DIR_ENTRY* entry) {
entry->dataStart.cluster = 0;
entry->dataStart.sector = 0;
entry->dataStart.offset = 0;
-
- entry->dataEnd = entry->dataStart;
-
+
+ entry->dataEnd = entry->dataStart;
+
memset (entry->filename, '\0', MAX_FILENAME_LENGTH);
entry->filename[0] = '.';
-
+
memset (entry->entryData, 0, DIR_ENTRY_DATA_SIZE);
memset (entry->entryData, ' ', 11);
entry->entryData[0] = '.';
-
+
entry->entryData[DIR_ENTRY_attributes] = ATTRIB_DIR;
-
+
u16_to_u8array (entry->entryData, DIR_ENTRY_cluster, partition->rootDirCluster);
u16_to_u8array (entry->entryData, DIR_ENTRY_clusterHigh, partition->rootDirCluster >> 16);
-
+
return true;
}
@@ -365,23 +365,23 @@ bool _FAT_directory_entryFromPosition (PARTITION* partition, DIR_ENTRY* entry) {
entryEnd = entry->dataEnd;
bool entryStillValid;
bool finished;
-
+
int i;
int lfnPos;
u8 entryData[DIR_ENTRY_DATA_SIZE];
-
+
memset (entry->filename, '\0', MAX_FILENAME_LENGTH);
// Create an empty directory entry to overwrite the old ones with
- for ( entryStillValid = true, finished = false;
- entryStillValid && !finished;
+ for ( entryStillValid = true, finished = false;
+ entryStillValid && !finished;
entryStillValid = _FAT_directory_incrementDirEntryPosition (partition, &entryStart, false))
{
- _FAT_cache_readPartialSector (partition->cache, entryData,
+ _FAT_cache_readPartialSector (partition->cache, entryData,
_FAT_fat_clusterToSector(partition, entryStart.cluster) + entryStart.sector,
entryStart.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE);
-
+
if ((entryStart.cluster == entryEnd.cluster)
&& (entryStart.sector == entryEnd.sector)
&& (entryStart.offset == entryEnd.offset)) {
@@ -400,7 +400,7 @@ bool _FAT_directory_entryFromPosition (PARTITION* partition, DIR_ENTRY* entry) {
if (!entryStillValid) {
return false;
}
-
+
if ((entryStart.cluster == entryEnd.cluster)
&& (entryStart.sector == entryEnd.sector)
&& (entryStart.offset == entryEnd.offset)) {
@@ -427,7 +427,7 @@ bool _FAT_directory_entryFromPath (PARTITION* partition, DIR_ENTRY* entry, const
bool found, notFound;
pathPosition = path;
-
+
found = false;
notFound = false;
@@ -453,13 +453,13 @@ bool _FAT_directory_entryFromPath (PARTITION* partition, DIR_ENTRY* entry, const
dirCluster = partition->cwdCluster;
}
- // If the path is only specifying a directory in the form "."
+ // If the path is only specifying a directory in the form "."
// and this is the root directory, return it
if ((dirCluster == partition->rootDirCluster) && (strncasecmp(".", pathPosition, 2) == 0)) {
_FAT_directory_getRootEntry (partition, entry);
found = true;
}
-
+
while (!found && !notFound) {
// Get the name of the next required subdirectory within the path
nextPathPosition = strchr (pathPosition, DIR_SEPARATOR);
@@ -542,8 +542,8 @@ bool _FAT_directory_removeEntry (PARTITION* partition, DIR_ENTRY* entry) {
u8 entryData[DIR_ENTRY_DATA_SIZE];
// Create an empty directory entry to overwrite the old ones with
- for ( entryStillValid = true, finished = false;
- entryStillValid && !finished;
+ for ( entryStillValid = true, finished = false;
+ entryStillValid && !finished;
entryStillValid = _FAT_directory_incrementDirEntryPosition (partition, &entryStart, false))
{
_FAT_cache_readPartialSector (partition->cache, entryData, _FAT_fat_clusterToSector(partition, entryStart.cluster) + entryStart.sector, entryStart.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE);
@@ -581,7 +581,7 @@ static bool _FAT_directory_findEntryGap (PARTITION* partition, DIR_ENTRY* entry,
entryStillValid = true;
dirEntryRemain = size;
endOfDirectory = false;
-
+
while (entryStillValid && !endOfDirectory && (dirEntryRemain > 0)) {
_FAT_cache_readPartialSector (partition->cache, entryData, _FAT_fat_clusterToSector(partition, gapEnd.cluster) + gapEnd.sector, gapEnd.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE);
if (entryData[0] == DIR_ENTRY_LAST) {
@@ -596,7 +596,7 @@ static bool _FAT_directory_findEntryGap (PARTITION* partition, DIR_ENTRY* entry,
} else {
dirEntryRemain = size;
}
-
+
if (!endOfDirectory && (dirEntryRemain > 0)) {
entryStillValid = _FAT_directory_incrementDirEntryPosition (partition, &gapEnd, true);
}
@@ -643,7 +643,7 @@ static bool _FAT_directory_entryExists (PARTITION* partition, const char* name,
if (dirnameLength >= MAX_FILENAME_LENGTH) {
return false;
}
-
+
// Make sure the entry doesn't already exist
foundFile = _FAT_directory_getFirstEntry (partition, &tempEntry, dirCluster);
@@ -801,7 +801,7 @@ bool _FAT_directory_addEntry (PARTITION* partition, DIR_ENTRY* entry, u32 dirClu
// Replace null and control characters with spaces
entry->entryData[i] = 0x20;
}
- }
+ }
// Generate alias checksum
for (i=0; i < 11; i++)
{
@@ -819,7 +819,7 @@ bool _FAT_directory_addEntry (PARTITION* partition, DIR_ENTRY* entry, u32 dirClu
// Write out directory entry
curEntryPos = entry->dataStart;
- for (entryStillValid = true, i = entrySize; entryStillValid && i > 0;
+ for (entryStillValid = true, i = entrySize; entryStillValid && i > 0;
entryStillValid = _FAT_directory_incrementDirEntryPosition (partition, &curEntryPos, false), -- i )
{
if (i > 1) {
@@ -848,7 +848,7 @@ bool _FAT_directory_addEntry (PARTITION* partition, DIR_ENTRY* entry, u32 dirClu
}
}
- return true;
+ return true;
}
bool _FAT_directory_chdir (PARTITION* partition, const char* path) {
@@ -879,7 +879,7 @@ void _FAT_directory_entryStat (PARTITION* partition, DIR_ENTRY* entry, struct st
st->st_uid = 1; // Faked for FAT
st->st_gid = 2; // Faked for FAT
st->st_rdev = st->st_dev;
- st->st_size = u8array_to_u32 (entry->entryData, DIR_ENTRY_fileSize); // File size
+ st->st_size = u8array_to_u32 (entry->entryData, DIR_ENTRY_fileSize); // File size
st->st_atime = _FAT_filetime_to_time_t (
0,
u8array_to_u16 (entry->entryData, DIR_ENTRY_aDate)
@@ -895,7 +895,7 @@ void _FAT_directory_entryStat (PARTITION* partition, DIR_ENTRY* entry, struct st
u8array_to_u16 (entry->entryData, DIR_ENTRY_cDate)
);
st->st_spare3 = 0;
- st->st_blksize = BYTES_PER_READ; // Prefered file I/O block size
+ st->st_blksize = BYTES_PER_READ; // Prefered file I/O block size
st->st_blocks = (st->st_size + BYTES_PER_READ - 1) / BYTES_PER_READ; // File size in blocks
st->st_spare4[0] = 0;
st->st_spare4[1] = 0;
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/directory.h b/c/src/lib/libbsp/arm/nds/libfat/source/directory.h
index 8a870d5f30..3c75658e7e 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/directory.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/directory.h
@@ -4,7 +4,7 @@
a FAT partition
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -130,7 +130,7 @@ Returns true on success, false on failure
*/
bool _FAT_directory_entryFromPath (PARTITION* partition, DIR_ENTRY* entry, const char* path, const char* pathEnd);
-/*
+/*
Changes the current directory to the one specified by path
Returns true on success, false on failure
*/
@@ -154,10 +154,10 @@ bool _FAT_directory_addEntry (PARTITION* partition, DIR_ENTRY* entry, u32 dirClu
/*
Get the start cluster of a file from it's entry data
*/
-u32 _FAT_directory_entryGetCluster (const u8* entryData);
+u32 _FAT_directory_entryGetCluster (const u8* entryData);
-/*
-Fill in the file name and entry data of DIR_ENTRY* entry.
+/*
+Fill in the file name and entry data of DIR_ENTRY* entry.
Assumes that the entry's dataStart and dataEnd are correct
Returns true on success, false on failure
*/
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc.c
index f1a1776c95..8eea5fcaba 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc.c
@@ -5,10 +5,10 @@
uniformed io-interface to work with Chishm's FAT library
Written by MightyMax
-
+
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -49,26 +49,26 @@
2006-05-18 - Chishm
* Rewritten for FATlib disc.c
-
+
2006-06-19 - Chishm
* Changed read and write interface to accept a u32 instead of a u8 for the number of sectors
-
+
2006-07-11 - Chishm
* Removed disc_Cache* functions, since there is now a proper unified cache
* Removed SUPPORT_* defines
* Rewrote device detection functions
* First libfat release
-
+
2006-07-25 - Chishm
* Changed IO_INTERFACEs to const
-
+
2006-08-02 - Chishm
* Added NinjaDS
-
+
2006-12-25 - Chishm
* Added DLDI
* Removed experimental interfaces
-
+
2007-05-01 - Chishm
* Removed FCSR
*/
@@ -153,7 +153,7 @@ const IO_INTERFACE* _FAT_disc_dsSlotFindInterface (void)
/*
* When running on an NDS, check the either slot for a valid memory
- * card interface.
+ * card interface.
* When running on a GBA, call _FAT_disc_gbaSlotFindInterface
* If an interface is found, it is set as the default interace
* and it returns true. Otherwise the default interface is left
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc.h
index f52d362caa..5bb21f171f 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc.h
@@ -2,9 +2,9 @@
disc.h
Interface to the low level disc functions. Used by the higher level
file system code.
-
+
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -68,7 +68,7 @@ static inline bool _FAT_disc_isInserted (const IO_INTERFACE* disc) {
}
/*
-Read numSectors sectors from a disc, starting at sector.
+Read numSectors sectors from a disc, starting at sector.
numSectors is between 1 and 256
sector is from 0 to 2^28
buffer is a pointer to the memory to fill
@@ -78,7 +78,7 @@ static inline bool _FAT_disc_readSectors (const IO_INTERFACE* disc, u32 sector,
}
/*
-Write numSectors sectors to a disc, starting at sector.
+Write numSectors sectors to a disc, starting at sector.
numSectors is between 1 and 256
sector is from 0 to 2^28
buffer is a pointer to the memory to read from
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc_io.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc_io.h
index c79036451d..916f94e5a3 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc_io.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc_io.h
@@ -3,7 +3,7 @@
Interface template for low level disc functions.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -27,7 +27,7 @@
2006-07-11 - Chishm
* Original release
-
+
2006-07-16 - Chishm
* Renamed _CF_USE_DMA to _IO_USE_DMA
* Renamed _CF_ALLOW_UNALIGNED to _IO_ALLOW_UNALIGNED
@@ -44,7 +44,7 @@
// Use DMA to read the card, remove this line to use normal reads/writes
// #define _IO_USE_DMA
-// Allow buffers not alligned to 16 bits when reading files.
+// Allow buffers not alligned to 16 bits when reading files.
// Note that this will slow down access speed, so only use if you have to.
// It is also incompatible with DMA
#define _IO_ALLOW_UNALIGNED
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_cf_common.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_cf_common.c
index f405d85ca0..386d24d5ed 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_cf_common.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_cf_common.c
@@ -4,14 +4,14 @@
compact_flash.c
By chishm (Michael Chisholm)
- Common hardware routines for using a compact flash card. This is not reentrant
- and does not do range checking on the supplied addresses. This is designed to
+ Common hardware routines for using a compact flash card. This is not reentrant
+ and does not do range checking on the supplied addresses. This is designed to
be as fast as possible.
CF routines modified with help from Darkfader
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -75,13 +75,13 @@ bool return OUT: true if a CF card is idle
-----------------------------------------------------------------*/
bool _CF_clearStatus (void) {
int i;
-
+
// Wait until CF card is finished previous commands
i=0;
while ((*(cfRegisters.command) & CF_STS_BUSY) && (i < CF_CARD_TIMEOUT)) {
i++;
}
-
+
// Wait until card is ready for commands
i = 0;
while ((!(*(cfRegisters.status) & CF_STS_INSERTED)) && (i < CF_CARD_TIMEOUT)) {
@@ -121,7 +121,7 @@ bool _CF_readSectors (u32 sector, u32 numSectors, void* buffer) {
while ((*(cfRegisters.command) & CF_STS_BUSY) && (i < CF_CARD_TIMEOUT)) {
i++;
}
-
+
// Wait until card is ready for commands
i = 0;
while ((!(*(cfRegisters.status) & CF_STS_INSERTED)) && (i < CF_CARD_TIMEOUT)) {
@@ -129,20 +129,20 @@ bool _CF_readSectors (u32 sector, u32 numSectors, void* buffer) {
}
if (i >= CF_CARD_TIMEOUT)
return false;
-
+
// Set number of sectors to read
- *(cfRegisters.sectorCount) = (numSectors < 256 ? numSectors : 0); // Read a maximum of 256 sectors, 0 means 256
-
+ *(cfRegisters.sectorCount) = (numSectors < 256 ? numSectors : 0); // Read a maximum of 256 sectors, 0 means 256
+
// Set read sector
*(cfRegisters.lba1) = sector & 0xFF; // 1st byte of sector number
*(cfRegisters.lba2) = (sector >> 8) & 0xFF; // 2nd byte of sector number
*(cfRegisters.lba3) = (sector >> 16) & 0xFF; // 3rd byte of sector number
*(cfRegisters.lba4) = ((sector >> 24) & 0x0F )| CF_CMD_LBA; // last nibble of sector number
-
+
// Set command to read
*(cfRegisters.command) = CF_CMD_READ;
-
-
+
+
while (numSectors--)
{
// Wait until card is ready for reading
@@ -153,7 +153,7 @@ bool _CF_readSectors (u32 sector, u32 numSectors, void* buffer) {
}
if (i >= CF_CARD_TIMEOUT)
return false;
-
+
// Read data
#ifdef _IO_USE_DMA
#ifdef NDS
@@ -175,12 +175,12 @@ bool _CF_readSectors (u32 sector, u32 numSectors, void* buffer) {
}
} else {
while(i--)
- *buff++ = *(cfRegisters.data);
+ *buff++ = *(cfRegisters.data);
}
#else
i=256;
while(i--)
- *buff++ = *(cfRegisters.data);
+ *buff++ = *(cfRegisters.data);
#endif
}
#if (defined _IO_USE_DMA) && (defined NDS)
@@ -209,7 +209,7 @@ bool _CF_writeSectors (u32 sector, u32 numSectors, void* buffer) {
u8 *buff_u8 = (u8*)buffer;
int temp;
#endif
-
+
#if defined _IO_USE_DMA && defined NDS && defined ARM9
DC_FlushRange( buffer, j * BYTES_PER_READ);
#endif
@@ -220,7 +220,7 @@ bool _CF_writeSectors (u32 sector, u32 numSectors, void* buffer) {
{
i++;
}
-
+
// Wait until card is ready for commands
i = 0;
while ((!(*(cfRegisters.status) & CF_STS_INSERTED)) && (i < CF_CARD_TIMEOUT))
@@ -229,19 +229,19 @@ bool _CF_writeSectors (u32 sector, u32 numSectors, void* buffer) {
}
if (i >= CF_CARD_TIMEOUT)
return false;
-
+
// Set number of sectors to write
- *(cfRegisters.sectorCount) = (numSectors < 256 ? numSectors : 0); // Write a maximum of 256 sectors, 0 means 256
-
+ *(cfRegisters.sectorCount) = (numSectors < 256 ? numSectors : 0); // Write a maximum of 256 sectors, 0 means 256
+
// Set write sector
*(cfRegisters.lba1) = sector & 0xFF; // 1st byte of sector number
*(cfRegisters.lba2) = (sector >> 8) & 0xFF; // 2nd byte of sector number
*(cfRegisters.lba3) = (sector >> 16) & 0xFF; // 3rd byte of sector number
*(cfRegisters.lba4) = ((sector >> 24) & 0x0F )| CF_CMD_LBA; // last nibble of sector number
-
+
// Set command to write
*(cfRegisters.command) = CF_CMD_WRITE;
-
+
while (numSectors--)
{
// Wait until card is ready for writing
@@ -252,7 +252,7 @@ bool _CF_writeSectors (u32 sector, u32 numSectors, void* buffer) {
}
if (i >= CF_CARD_TIMEOUT)
return false;
-
+
// Write data
#ifdef _IO_USE_DMA
#ifdef NDS
@@ -274,19 +274,19 @@ bool _CF_writeSectors (u32 sector, u32 numSectors, void* buffer) {
}
} else {
while(i--)
- *(cfRegisters.data) = *buff++;
+ *(cfRegisters.data) = *buff++;
}
#else
i=256;
while(i--)
- *(cfRegisters.data) = *buff++;
+ *(cfRegisters.data) = *buff++;
#endif
}
#if defined _IO_USE_DMA && defined NDS
// Wait for end of transfer before returning
while(DMA3_CR & DMA_BUSY);
#endif
-
+
return true;
}
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_cf_common.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_cf_common.h
index 3c3fb4b4b3..e08c1a9503 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_cf_common.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_cf_common.h
@@ -6,7 +6,7 @@
Common Compact Flash card values
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -30,7 +30,7 @@
2006-07-11 - Chishm
* Original release
-
+
2006-07-16 - Chishm
* Combined all CF interfaces into one common set of routines
*/
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_dldi.S b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_dldi.S
index 3c71649a8a..d087bbd94d 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_dldi.S
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_dldi.S
@@ -19,7 +19,7 @@ _dldi_start:
.byte 0x0F @32KiB @ Log [base-2] of the size of this driver in bytes.
.byte 0x00 @ Sections to fix
.byte 0x0F @32KiB @ Log [base-2] of the allocated space in bytes.
-
+
@---------------------------------------------------------------------------------
@ Text identifier - can be anything up to 47 chars + terminating null -- 16 bytes
.align 4
@@ -42,13 +42,13 @@ _dldi_start:
_io_dldi:
.ascii "DLDI" @ ioType
.word 0x00000000 @ Features
- .word _DLDI_startup @
- .word _DLDI_isInserted @
+ .word _DLDI_startup @
+ .word _DLDI_isInserted @
.word _DLDI_readSectors @ Function pointers to standard device driver functions
- .word _DLDI_writeSectors @
- .word _DLDI_clearStatus @
- .word _DLDI_shutdown @
-
+ .word _DLDI_writeSectors @
+ .word _DLDI_clearStatus @
+ .word _DLDI_shutdown @
+
@---------------------------------------------------------------------------------
_DLDI_startup:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_dldi.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_dldi.h
index dea25adb2e..97483914ff 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_dldi.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_dldi.h
@@ -1,10 +1,10 @@
/*
- io_dldi.h
+ io_dldi.h
Reserved space for post-compilation adding of an extra driver
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_efa2.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_efa2.c
index b3c313aba6..8b2ec39324 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_efa2.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_efa2.c
@@ -45,7 +45,7 @@ drop chishm <at> hotmail <dot> com a line
// ID of Samsung K9K1G NAND flash chip
#define EFA2_NAND_ID 0xEC79A5C0
-// first sector of udisk
+// first sector of udisk
#define EFA2_UDSK_START 0x40
//
@@ -99,7 +99,7 @@ static void _EFA2_nand_lock(void) {
//
// Set NAND Flash chip enable and write protection bits ?
-//
+//
// val | ~CE | ~WP |
// -----+-----+-----+
// 0 | 0 | 0 |
@@ -123,7 +123,7 @@ static inline void _EFA2_nand_reset(void) {
//
// Read out NAND ID information, could be used for card detection
-//
+//
// | EFA2 1GBit |
// ------------------+------------+
// maker code | 0xEC |
@@ -164,7 +164,7 @@ EFA2_clearStatus
Reads and checks NAND status information
bool return OUT: true if NAND is idle
-----------------------------------------------------------------*/
-bool _EFA2_clearStatus (void)
+bool _EFA2_clearStatus (void)
{
// tbd: currently there is no write support, so always return
// true, there is no possibility for pending operations
@@ -176,7 +176,7 @@ EFA2_isInserted
Checks to see if the NAND chip used by the EFA2 is present
bool return OUT: true if the correct NAND chip is found
-----------------------------------------------------------------*/
-bool _EFA2_isInserted (void)
+bool _EFA2_isInserted (void)
{
_EFA2_clearStatus();
return (_EFA2_nand_id() == EFA2_NAND_ID);
@@ -219,7 +219,7 @@ bool _EFA2_readSectors (u32 sector, u32 numSecs, void* buffer)
_EFA2_nand_reset();
// set NAND to READ1 operation mode and transfer page address
- REG_EFA2_NAND_CMD = 0x00; // write READ1 command
+ REG_EFA2_NAND_CMD = 0x00; // write READ1 command
REG_EFA2_NAND_WR = 0x00; // write address [7:0]
REG_EFA2_NAND_WR = (page ) & 0xff; // write address [15:8]
REG_EFA2_NAND_WR = (page >> 8 ) & 0xff; // write address[23:16]
@@ -276,7 +276,7 @@ bool _EFA2_writeSectors (u32 sector, u8 numSecs, void* buffer)
EFA2_shutdown
unload the EFA2 interface
-----------------------------------------------------------------*/
-bool _EFA2_shutdown(void)
+bool _EFA2_shutdown(void)
{
return _EFA2_clearStatus();
}
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_efa2.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_efa2.h
index 04f8ef1642..d3a5e29c31 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_efa2.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_efa2.h
@@ -1,11 +1,11 @@
/*
io_efa2.h by CyteX
-
+
Based on io_mpfc.h by chishm (Michael Chisholm)
-
+
Hardware Routines for reading the NAND flash located on
EFA2 flash carts
-
+
Used with permission from Cytex.
*/
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.c
index 3a4b25ebde..bf4d276fb9 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.c
@@ -4,14 +4,14 @@
compact_flash.c
By chishm (Michael Chisholm)
- Hardware Routines for using a GBA Flash Cart and SRAM as a
+ Hardware Routines for using a GBA Flash Cart and SRAM as a
block device.
The file system must be 512 byte aligned, in cart address space.
SRAM is supported.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -73,7 +73,7 @@ _FCSR_isInserted
Is a GBA Flash Cart with a valid file system inserted?
bool return OUT: true if a GBA FC card is inserted
-----------------------------------------------------------------*/
-bool _FCSR_isInserted (void)
+bool _FCSR_isInserted (void)
{
bool flagFoundFileSys = false;
@@ -101,7 +101,7 @@ _FCSR_clearStatus
Finish any pending operations
bool return OUT: always true for GBA FC
-----------------------------------------------------------------*/
-bool _FCSR_clearStatus (void)
+bool _FCSR_clearStatus (void)
{
return true;
}
@@ -117,7 +117,7 @@ void* buffer OUT: pointer to 512 byte buffer to store data in
bool return OUT: true if successful
-----------------------------------------------------------------*/
bool _FCSR_readSectors (u32 sector, u32 numSectors, void* buffer)
-{
+{
int i;
bool flagSramSector = false;
int readLength = numSectors * BYTES_PER_READ;
@@ -223,14 +223,14 @@ bool _FCSR_writeSectors (u32 sector, u8 numSectors, void* buffer)
_FCSR_shutdown
unload the Flash Cart interface
-----------------------------------------------------------------*/
-bool _FCSR_shutdown(void)
+bool _FCSR_shutdown(void)
{
int i;
if (_FCSR_clearStatus() == false)
return false;
_FCSR_FileSysPointer = 0;
-
+
for (i=0; i < 4; i++)
{
_FCSR_SramSectorPointer[i] = 0;
@@ -277,11 +277,11 @@ bool _FCSR_startUp(void)
// Get SRAM sector regions from header block
for (i = 0; i < 4; i++)
{
- _FCSR_SramSectorStart[i] = fileSysPointer[i+4];
+ _FCSR_SramSectorStart[i] = fileSysPointer[i+4];
SramRegionSize[i] = fileSysPointer[i+8];
_FCSR_SramSectorEnd[i] = _FCSR_SramSectorStart[i] + SramRegionSize[i];
}
-
+
// Calculate SRAM region pointers
_FCSR_SramSectorPointer[0] = (u8*)(SRAM_START + 4);
for (i = 1; i < 4; i++)
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.h
index 1b6def27aa..19b2537960 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.h
@@ -1,10 +1,10 @@
/*
- io_fcsr.h
+ io_fcsr.h
Hardware Routines for using a GBA Flash Cart with SRAM
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3_common.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3_common.c
index ab2c143327..9c8280c808 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3_common.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3_common.c
@@ -1,13 +1,13 @@
/*
- io_m3_common.c
+ io_m3_common.c
Routines common to all version of the M3
-
+
Some code based on M3 SD drivers supplied by M3Adapter.
Some code written by SaTa may have been unknowingly used.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -47,7 +47,7 @@ void _M3_changeMode (u32 mode) {
_M3_readHalfword (0x08000000 + (mode << 1));
_M3_readHalfword (0x0800080e);
_M3_readHalfword (0x08000000);
-
+
if ((mode & 0x0f) != 4) {
_M3_readHalfword (0x09000000);
} else {
@@ -56,5 +56,5 @@ void _M3_changeMode (u32 mode) {
_M3_readHalfword (0x08000188);
_M3_readHalfword (0x08000188);
}
-}
+}
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3_common.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3_common.h
index 92e6bed980..6d0c669783 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3_common.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3_common.h
@@ -1,5 +1,5 @@
/*
- io_m3_common.h
+ io_m3_common.h
Routines common to all version of the M3
@@ -7,7 +7,7 @@
Some code written by SaTa may have been unknowingly used.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -40,7 +40,7 @@
// Values for changing mode
#define M3_MODE_ROM 0x00400004
-#define M3_MODE_MEDIA 0x00400003
+#define M3_MODE_MEDIA 0x00400003
extern void _M3_changeMode (u32 mode);
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3cf.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3cf.c
index d416a4b6f3..235788a2f5 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3cf.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3cf.c
@@ -10,7 +10,7 @@
CF routines modified with help from Darkfader
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3cf.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3cf.h
index c8f3fba67d..c72da0b4a2 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3cf.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3cf.h
@@ -1,11 +1,11 @@
/*
- io_m3cf.h
+ io_m3cf.h
Hardware Routines for reading a compact flash card
using the M3 CF
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3sd.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3sd.c
index 322ad007f3..88f205a249 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3sd.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3sd.c
@@ -1,14 +1,14 @@
/*
- io_m3sd.c
+ io_m3sd.c
Hardware Routines for reading a Secure Digital card
using the M3 SD
-
+
Some code based on M3 SD drivers supplied by M3Adapter.
Some code written by SaTa may have been unknowingly used.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -29,7 +29,7 @@
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
2006-07-25 - Chishm
* Improved startup function that doesn't delay hundreds of seconds
before reporting no card inserted.
@@ -38,7 +38,7 @@
2006-08-05 - Chishm
* Tries multiple times to get a Relative Card Address at startup
-
+
2006-08-07 - Chishm
* Moved the SD initialization to a common function
*/
@@ -104,7 +104,7 @@ static bool _M3SD_sendCommand (u16 command, u32 argument) {
REG_M3SD_ARGH = argument >> 16;
REG_M3SD_ARGL = argument;
// The CRC7 of the command is calculated by the M3
-
+
REG_M3SD_DIR=0x29;
if (!_M3SD_waitOnBusy()) {
REG_M3SD_DIR=0x09;
@@ -156,10 +156,10 @@ static u8 _M3SD_getByte (void) {
// Returns the response from the SD card to a previous command.
static bool _M3SD_getResponse (u8* dest, u32 length) {
- u32 i;
+ u32 i;
u8 dataByte;
int shiftAmount;
-
+
// Wait for the card to be non-busy
for (i = 0; i < RESPONSE_TIMEOUT; i++) {
dataByte = _M3SD_getByte();
@@ -167,27 +167,27 @@ static bool _M3SD_getResponse (u8* dest, u32 length) {
break;
}
}
-
+
if (dest == NULL) {
return true;
}
-
+
// Still busy after the timeout has passed
if (dataByte == 0xff) {
return false;
}
-
+
// Read response into buffer
for ( i = 0; i < length; i++) {
dest[i] = dataByte;
dataByte = _M3SD_getByte();
}
// dataByte will contain the last piece of the response
-
+
// Send 16 more clocks, 8 more than the delay required between a response and the next command
i = _M3SD_getByte();
i = _M3SD_getByte();
-
+
// Shift response so that the bytes are correctly aligned
// The register may not contain properly aligned data
for (shiftAmount = 0; ((dest[0] << shiftAmount) & 0x80) != 0x00; shiftAmount++) {
@@ -195,7 +195,7 @@ static bool _M3SD_getResponse (u8* dest, u32 length) {
return false;
}
}
-
+
for (i = 0; i < length - 1; i++) {
dest[i] = (dest[i] << shiftAmount) | (dest[i+1] >> (8-shiftAmount));
}
@@ -251,7 +251,7 @@ bool _M3SD_cmd_17byte_response (u8* responseBuffer, u8 command, u32 data) {
static bool _M3SD_initCard (void) {
// Give the card time to stabilise
_M3SD_sendClocks (NUM_STARTUP_CLOCKS);
-
+
// Reset the card
if (!_M3SD_sendCommand (GO_IDLE_STATE, 0)) {
return false;
@@ -261,9 +261,9 @@ static bool _M3SD_initCard (void) {
// Card is now reset, including it's address
_M3SD_relativeCardAddress = 0;
-
+
// Init the card
- return _SD_InitCard (_M3SD_cmd_6byte_response,
+ return _SD_InitCard (_M3SD_cmd_6byte_response,
_M3SD_cmd_17byte_response,
true,
&_M3SD_relativeCardAddress);
@@ -281,10 +281,10 @@ static bool _M3SD_readData (void* buffer) {
return false;
}
REG_M3SD_DIR = 0x09;
-
+
REG_M3SD_DIR = 0x8;
REG_M3SD_STS = 0x4;
-
+
i = REG_M3SD_DIR;
// Read data
i=256;
@@ -297,11 +297,11 @@ static bool _M3SD_readData (void* buffer) {
}
} else {
while(i--)
- *buff++ = REG_M3SD_DIR;
+ *buff++ = REG_M3SD_DIR;
}
// Read end checksum
i = REG_M3SD_DIR + REG_M3SD_DIR + REG_M3SD_DIR + REG_M3SD_DIR;
-
+
return true;
}
@@ -309,7 +309,7 @@ static void _M3SD_clkout (void) {
REG_M3SD_DIR = 0x4;
REG_M3SD_DIR = 0xc;
/* __asm volatile (
- "ldr r1, =0x08800000 \n"
+ "ldr r1, =0x08800000 \n"
"mov r0, #0x04 \n"
"strh r0, [r1] \n"
"mov r0, r0 \n"
@@ -326,7 +326,7 @@ static void _M3SD_clkin (void) {
REG_M3SD_DIR = 0x0;
REG_M3SD_DIR = 0x8;
/* __asm volatile (
- "ldr r1, =0x08800000 \n"
+ "ldr r1, =0x08800000 \n"
"mov r0, #0x00 \n"
"strh r0, [r1] \n"
"mov r0, r0 \n"
@@ -346,11 +346,11 @@ static bool _M3SD_writeData (u8* data, u8* crc) {
do {
_M3SD_clkin();
} while ((REG_M3SD_DAT & 0x100) == 0);
-
+
REG_M3SD_DAT = 0; // Start bit
-
+
_M3SD_clkout();
-
+
for (i = 0; i < BYTES_PER_READ; i++) {
temp = (*data++);
REG_M3SD_DAT = temp >> 4;
@@ -358,7 +358,7 @@ static bool _M3SD_writeData (u8* data, u8* crc) {
REG_M3SD_DAT = temp;
_M3SD_clkout();
}
-
+
if (crc != NULL) {
for (i = 0; i < 8; i++) {
temp = (*crc++);
@@ -373,16 +373,16 @@ static bool _M3SD_writeData (u8* data, u8* crc) {
while (i--) {
temp += 2; // a NOP to stop the compiler optimising out the loop
}
-
+
for (i = 0; i < 32; i++) {
REG_M3SD_DAT = 0xff;
_M3SD_clkout();
}
-
+
do {
_M3SD_clkin();
} while ((REG_M3SD_DAT & 0x100) == 0);
-
+
return true;
}
@@ -415,7 +415,7 @@ bool _M3SD_readSectors (u32 sector, u32 numSectors, void* buffer) {
u32 i;
u8* dest = (u8*) buffer;
u8 responseBuffer[6];
-
+
if (numSectors == 1) {
// If it's only reading one sector, use the (slightly faster) READ_SINGLE_BLOCK
if (!_M3SD_sendCommand (READ_SINGLE_BLOCK, sector * BYTES_PER_READ)) {
@@ -431,14 +431,14 @@ bool _M3SD_readSectors (u32 sector, u32 numSectors, void* buffer) {
if (!_M3SD_sendCommand (READ_MULTIPLE_BLOCK, sector * BYTES_PER_READ)) {
return false;
}
-
+
for(i=0; i < numSectors; i++, dest+=BYTES_PER_READ) {
if (!_M3SD_readData(dest)) {
return false;
}
REG_M3SD_STS = 0x8;
}
-
+
// Stop the streaming
_M3SD_sendCommand (STOP_TRANSMISSION, 0);
_M3SD_getResponse_R1b (responseBuffer);
@@ -455,29 +455,29 @@ bool _M3SD_writeSectors (u32 sector, u32 numSectors, const void* buffer) {
int i;
// Precalculate the data CRC
_SD_CRC16 ( data, BYTES_PER_READ, crc);
-
+
while (numSectors--) {
// Send a single sector write command
_M3SD_sendCommand (WRITE_BLOCK, offset);
if (!_M3SD_getResponse_R1 (responseBuffer)) {
return false;
}
-
+
REG_M3SD_DIR = 0x4;
REG_M3SD_STS = 0x0;
-
+
// Send the data
if (! _M3SD_writeData( data, crc)) {
return false;
}
-
+
if (numSectors > 0) {
offset += BYTES_PER_READ;
data += BYTES_PER_READ;
// Calculate the next CRC while waiting for the card to finish writing
_SD_CRC16 ( data, BYTES_PER_READ, crc);
}
-
+
// Wait for the card to be ready for the next transfer
i = WRITE_TIMEOUT;
responseBuffer[3] = 0;
@@ -490,7 +490,7 @@ bool _M3SD_writeSectors (u32 sector, u32 numSectors, const void* buffer) {
}
} while (((responseBuffer[3] & 0x1f) != ((SD_STATE_TRAN << 1) | READY_FOR_DATA)));
}
-
+
return true;
}
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3sd.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3sd.h
index 3fa77494f8..0e4d32b540 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3sd.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_m3sd.h
@@ -1,5 +1,5 @@
/*
- io_m3sd.h
+ io_m3sd.h
Hardware Routines for reading a Secure Digital card
using the M3 SD
@@ -8,7 +8,7 @@
Some code written by SaTa may have been unknowingly used.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_mpcf.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_mpcf.c
index 22cfac4b8a..f004126aed 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_mpcf.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_mpcf.c
@@ -10,7 +10,7 @@
CF routines modified with help from Darkfader
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_mpcf.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_mpcf.h
index 591d531055..fc5770e18d 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_mpcf.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_mpcf.h
@@ -1,11 +1,11 @@
/*
- io_mpcf.h
+ io_mpcf.h
Hardware Routines for reading a compact flash card
using the GBA Movie Player
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_njsd.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_njsd.c
index de369ad3b6..b60f1a693e 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_njsd.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_njsd.c
@@ -3,11 +3,11 @@
Hardware Routines for reading an SD card using
a NinjaDS SD adapter.
-
+
Original code supplied by NinjaMod
-
+
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -28,14 +28,14 @@
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
2006-08-05 - Chishm
* First release
-
+
2006-08-06 - Chishm
* Removed unneeded _NJSD_writeRAM function
* Removed casts for calls to cardWriteCommand
-
+
2006-08-07 - Chishm
* Moved the SD initialization to a common function
*/
@@ -83,7 +83,7 @@ static u32 _NJSD_relativeCardAddress = 0;
static inline bool _NJSD_waitIRQ(void) {
int i = IRQ_TIMEOUT;
- while (!(REG_IF & 0x100000) && --i);
+ while (!(REG_IF & 0x100000) && --i);
REG_IF = 0x100000;
if (i <= 0) {
return false;
@@ -92,8 +92,8 @@ static inline bool _NJSD_waitIRQ(void) {
}
}
-static inline void _NJSD_writeCardCommand
- (u8 cmd0, u8 cmd1, u8 cmd2, u8 cmd3, u8 cmd4, u8 cmd5, u8 cmd6, u8 cmd7)
+static inline void _NJSD_writeCardCommand
+ (u8 cmd0, u8 cmd1, u8 cmd2, u8 cmd3, u8 cmd4, u8 cmd5, u8 cmd6, u8 cmd7)
{
CARD_COMMAND[0] = cmd0;
CARD_COMMAND[1] = cmd1;
@@ -115,7 +115,7 @@ static bool _NJSD_reset (void) {
if (i <= 0) {
return false;
}
-
+
return true;
}
@@ -153,7 +153,7 @@ static bool _NJSD_sendCMDR (int speed, u8 *rsp_buf, int type, u8 cmd, u32 param)
} else {
CARD_COMMAND[0] = 0xF0 | (speed << 2) | 0 | (1 << 1);
}
-
+
CARD_COMMAND[1] = (type & 0x40) | ((( type >> 2) & 7) << 3);
CARD_COMMAND[2] = 0x40 | cmd;
CARD_COMMAND[3] = (param>>24) & 0xFF;
@@ -285,7 +285,7 @@ static bool _NJSD_writeSector (u8 *buffer, u8 *crc_buf, u32 offset) {
i++;
}
} while (CARD_CR2 & CARD_BUSY);
-
+
i = WRITE_TIMEOUT;
responseBuffer[3] = 0;
do {
@@ -303,7 +303,7 @@ static bool _NJSD_writeSector (u8 *buffer, u8 *crc_buf, u32 offset) {
#ifdef _NJSD_SYNC
REG_IME = old_REG_IME;
#endif
-
+
return true;
}
@@ -320,7 +320,7 @@ static bool _NJSD_sendCLK (int speed, int count) {
//CARD_CR1H = CARD_CR1_ENABLE; // | CARD_CR1_IRQ;
_NJSD_writeCardCommand (0xE0 | ((speed & 3) << 2), 0, (count - 1), 0, 0, 0, 0, 0);
-
+
CARD_CR2 = _NJSD_cardFlags;
i = COMMAND_TIMEOUT;
while ((CARD_CR2 & CARD_BUSY) && --i);
@@ -401,12 +401,12 @@ static bool _NJSD_cardInit (void) {
return false;
}
_NJSD_sendCLK (SD_CLK_167KHz, 8);
-
+
_NJSD_sendCLK (SD_CLK_167KHz, 256);
_NJSD_sendCMDN (SD_CLK_167KHz, GO_IDLE_STATE, 0);
_NJSD_sendCLK (SD_CLK_167KHz, 8);
-
- return _SD_InitCard (_NJSD_cmd_6byte_response,
+
+ return _SD_InitCard (_NJSD_cmd_6byte_response,
_NJSD_cmd_17byte_response,
true,
&_NJSD_relativeCardAddress);
@@ -440,7 +440,7 @@ bool _NJSD_startup(void) {
return false;
}
return true;
-}
+}
bool _NJSD_writeSectors (u32 sector, u32 numSectors, const void* buffer) {
@@ -450,7 +450,7 @@ bool _NJSD_writeSectors (u32 sector, u32 numSectors, const void* buffer) {
while (numSectors--) {
_SD_CRC16 ( data, BYTES_PER_READ, crc);
-
+
if (! _NJSD_writeSector (data, crc, offset)) {
return false;
}
@@ -468,7 +468,7 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
#ifdef _NJSD_SYNC
u32 old_REG_IME;
#endif
-
+
u8* tbuf = (u8*)buffer;
if (numSectors == 0) {
@@ -492,7 +492,7 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
if (!_NJSD_waitIRQ ()) {
#ifdef _NJSD_SYNC
REG_IME = old_REG_IME;
-#endif
+#endif
return false;
}
}
@@ -505,10 +505,10 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
if (!_NJSD_waitIRQ ()) {
#ifdef _NJSD_SYNC
REG_IME = old_REG_IME;
-#endif
+#endif
return false;
}
-
+
if (((int)buffer & 0x03) != 0){
cardPolledTransfer (0xA1406000, tmp, BYTES_PER_READ, _NJSD_read_cmd);
memcpy (tbuf + (numSectors - 1) * BYTES_PER_READ, tmp, BYTES_PER_READ);
@@ -537,7 +537,7 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
#ifdef _NJSD_SYNC
u32 old_REG_IME;
#endif
-
+
u8* tbuf = (u8*)buffer;
if (numSectors == 0) {
@@ -556,7 +556,7 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
if (!_NJSD_waitIRQ ()) {
#ifdef _NJSD_SYNC
REG_IME = old_REG_IME;
-#endif
+#endif
return false;
}
}
@@ -564,10 +564,10 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
if (!_NJSD_waitIRQ ()) {
#ifdef _NJSD_SYNC
REG_IME = old_REG_IME;
-#endif
+#endif
return false;
}
-
+
cardPolledTransfer (0xA1406000, (u32*)(tbuf + (numSectors - 1) * BYTES_PER_READ), BYTES_PER_READ, _NJSD_read_cmd);
} else {
_NJSD_sendCMDR (_NJSD_speed, NULL, SD_RSP_STREAM, READ_SINGLE_BLOCK, sector * BYTES_PER_READ);
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_njsd.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_njsd.h
index 9da9f22b56..b668a510bc 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_njsd.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_njsd.h
@@ -1,11 +1,11 @@
/*
- io_njsd.h
+ io_njsd.h
Hardware Routines for reading an SD card using
a NinjaDS SD adapter.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_nmmc.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_nmmc.c
index 913594bf83..d7a99320f3 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_nmmc.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_nmmc.c
@@ -9,10 +9,10 @@
Submit bug reports for this device to the NeoFlash forums
See license.txt for license details.
-
+
2006-02-09 - www.neoflash.com:
* First stable release
-
+
2006-02-13 - Chishm
* Added ReadMK2Config function
* Added read config test to init function so no unnecessary card commands are sent
@@ -83,7 +83,7 @@ static void _Neo_WriteMK2Config(u8 config) {
_Neo_EnableEEPROM(false);
}
-static u8 _Neo_ReadMK2Config(void)
+static u8 _Neo_ReadMK2Config(void)
{
u8 config;
_Neo_EnableEEPROM(true);
@@ -100,7 +100,7 @@ static u8 _Neo_ReadMK2Config(void)
u8 selectMMC_command [8] = {0xFF, 0x00, 0x6A, 0xDF, 0x37, 0x59, 0x33, 0xA3};
-static void _Neo_SelectMMC (u8 dataByte)
+static void _Neo_SelectMMC (u8 dataByte)
{
selectMMC_command[1] = dataByte; // Set enable / disable byte
cardWriteCommand (selectMMC_command); // Send "5. Use the EEPROM CS to access the MK2 MMC/SD card"
@@ -150,12 +150,12 @@ static bool _Neo_CheckMMCResponse( u8 response, u8 mask ) {
static bool _Neo_InitMMC(void) {
_Neo_MK2GameMode();
_Neo_WriteMK2Config( MK2_CONFIG_ZIP_RAM_CLOSE | MK2_CONFIG_GAME_FLASH_CLOSE);
-
+
// Make sure the configuration was accepted
if (_Neo_ReadMK2Config() != (MK2_CONFIG_ZIP_RAM_CLOSE | MK2_CONFIG_GAME_FLASH_CLOSE)) {
return false; // If not, then it wasn't initialised properly
}
-
+
return true;
}
@@ -163,7 +163,7 @@ static bool _Neo_InitMMC(void) {
bool _NMMC_isInserted(void) {
int i;
-
+
_Neo_EnableMMC( true ); // Open SPI port to MMC card
_Neo_SendMMCCommand(MMC_SEND_CSD, 0);
if( _Neo_CheckMMCResponse( 0x00, 0xFF ) == false ) { // Make sure no errors occured
@@ -179,13 +179,13 @@ bool _NMMC_isInserted(void) {
for (i = 0; i < 28; i++) {
_Neo_SPI(0xff);
}
-
+
return true;
}
bool _NMMC_clearStatus (void) {
u32 i;
-
+
_Neo_EnableMMC( true ); // Open SPI port to MMC card
for (i = 0; i < 10; i++) {
_Neo_SPI(0xFF); // Send 10 0xFF bytes to MMC card
@@ -220,14 +220,14 @@ bool _NMMC_startUp(void) {
return false;
}
_Neo_EnableMMC( true ); // Open SPI port to MMC card
-
+
// Set block length
_Neo_SendMMCCommand(MMC_SET_BLOCKLEN, BYTES_PER_READ );
if( _Neo_CheckMMCResponse( 0x00, 0xFF ) == false ) { // Make sure no errors occured
_Neo_EnableMMC( false );
return false;
}
-
+
// Check if we can use a higher SPI frequency
_Neo_SendMMCCommand(MMC_SEND_CSD, 0);
if( _Neo_CheckMMCResponse( 0x00, 0xFF ) == false ) { // Make sure no errors occured
@@ -248,76 +248,76 @@ bool _NMMC_startUp(void) {
if ((transSpeed & 0xf0) >= 0x30) {
_NMMC_spi_freq = 0;
}
-
+
_Neo_EnableMMC( false );
-
+
return true;
-}
+}
-bool _NMMC_writeSectors (u32 sector, u32 totalSecs, const void* buffer)
+bool _NMMC_writeSectors (u32 sector, u32 totalSecs, const void* buffer)
{
u32 i;
u8 *p=(u8*)buffer;
-
+
sector *= BYTES_PER_READ;
-
+
_Neo_EnableMMC( true ); // Open SPI port to MMC card
_Neo_SendMMCCommand( 25, sector );
if( _Neo_CheckMMCResponse( 0x00, 0xFF ) == false ) { // Make sure no errors occured
_Neo_EnableMMC( false );
return false;
}
-
+
while (totalSecs--) {
_Neo_SPI( 0xFC ); // Send Start Block token
for( i = 0; i < BYTES_PER_READ; i++ ) // Send a block of data
_Neo_SPI( *p++ );
_Neo_SPI( 0xFF ); // Send fake CRC16
_Neo_SPI( 0xFF ); // Send fake CRC16
-
+
if( ( _Neo_SPI( 0xFF ) & 0x0F ) != 0x05 ) { // Make sure the block was accepted
_Neo_EnableMMC( false );
return false;
}
while( _Neo_SPI( 0xFF ) == 0x00 ); // Wait for the block to be written
}
-
+
// Stop transmission block
_Neo_SPI( 0xFD ); // Send Stop Transmission Block token
for( i = 0; i < BYTES_PER_READ; i++ ) // Send a block of fake data
_Neo_SPI( 0xFF );
_Neo_SPI( 0xFF ); // Send fake CRC16
_Neo_SPI( 0xFF ); // Send fake CRC16
-
+
_Neo_SPI (0xFF); // Send 8 clocks
while( _Neo_SPI( 0xFF ) == 0x00 ); // Wait for the busy signal to clear
-
- for ( i = 0; i < 0x10; i++) {
+
+ for ( i = 0; i < 0x10; i++) {
_Neo_SPI (0xFF); // Send clocks for the MMC card to finish what it's doing
}
-
+
_Neo_EnableMMC( false ); // Close SPI port to MMC card
return true;
}
-bool _NMMC_readSectors (u32 sector, u32 totalSecs, void* buffer)
+bool _NMMC_readSectors (u32 sector, u32 totalSecs, void* buffer)
{
u32 i;
u8 *p=(u8*)buffer;
-
+
sector *= BYTES_PER_READ;
-
+
_Neo_EnableMMC( true ); // Open SPI port to MMC card
-
+
while (totalSecs--) {
_Neo_SendMMCCommand(MMC_READ_BLOCK, sector );
if( _Neo_CheckMMCResponse( 0x00, 0xFF ) == false ) { // Make sure no errors occured
_Neo_EnableMMC( false );
return false;
}
-
+
if( _Neo_CheckMMCResponse( 0xFE, 0xFF ) == false ) { // Check for Start Block token
_Neo_EnableMMC( false );
return false;
@@ -328,7 +328,7 @@ bool _NMMC_readSectors (u32 sector, u32 totalSecs, void* buffer)
_Neo_SPI( 0xFF ); // Ignore CRC16
sector += BYTES_PER_READ;
}
-
+
_Neo_EnableMMC( false ); // Close SPI port to MMC card
return true;
}
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_nmmc.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_nmmc.h
index fdb8aac9df..aeb2c64222 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_nmmc.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_nmmc.h
@@ -1,5 +1,5 @@
/*
- io_nmmc.h
+ io_nmmc.h
Hardware Routines for reading an SD or MMC card using
a Neoflash MK2 or MK3.
@@ -8,7 +8,7 @@
moddified and used with permission of www.neoflash.com
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sc_common.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sc_common.c
index 7035e12686..9dabbdcd84 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sc_common.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sc_common.c
@@ -1,10 +1,10 @@
/*
- io_m3_common.h
+ io_m3_common.h
Routines common to all version of the Super Card
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -42,6 +42,6 @@ void _SC_changeMode(u8 mode) {
*unlockAddress = 0xA55A ;
*unlockAddress = mode ;
*unlockAddress = mode ;
-}
+}
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sc_common.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sc_common.h
index c8ead2010a..da30b7e5e3 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sc_common.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sc_common.h
@@ -1,10 +1,10 @@
/*
- io_sc_common.h
+ io_sc_common.h
Routines common to all version of the Super Card
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -37,7 +37,7 @@
// Values for changing mode
#define SC_MODE_RAM 0x5
-#define SC_MODE_MEDIA 0x3
+#define SC_MODE_MEDIA 0x3
#define SC_MODE_RAM_RO 0x1
extern void _SC_changeMode (u8 mode);
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sccf.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sccf.c
index ec78b29512..0765c4d379 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sccf.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sccf.c
@@ -10,7 +10,7 @@
CF routines modified with help from Darkfader
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -66,7 +66,7 @@ static const CF_REGISTERS _SCCF_Registers = {
bool _SCCF_startup(void) {
- _SC_changeMode (SC_MODE_MEDIA);
+ _SC_changeMode (SC_MODE_MEDIA);
return _CF_startup(&_SCCF_Registers);
}
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sccf.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sccf.h
index 6deaef2502..86e428bfd5 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sccf.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sccf.h
@@ -1,11 +1,11 @@
/*
- io_sccf.h
+ io_sccf.h
Hardware Routines for reading a compact flash card
using the Supercard CF
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd.c
index bdb4b1ec33..54347ccb33 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd.c
@@ -1,14 +1,14 @@
/*
- io_scsd.c
+ io_scsd.c
Hardware Routines for reading a Secure Digital card
using the SC SD
-
- Some code based on scsd_c.c, written by Amadeus
+
+ Some code based on scsd_c.c, written by Amadeus
and Jean-Pierre Thomasset as part of DSLinux.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -29,20 +29,20 @@
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
2006-07-22 - Chishm
* First release of stable code
-
+
2006-07-25 - Chishm
* Improved startup function that doesn't delay hundreds of seconds
before reporting no card inserted.
2006-08-05 - Chishm
* Tries multiple times to get a Relative Card Address at startup
-
+
2006-08-07 - Chishm
* Moved the SD initialization to a common function
-
+
2006-08-19 - Chishm
* Added SuperCard Lite support
*/
@@ -88,7 +88,7 @@ static u32 _SCSD_relativeCardAddress = 0; // Preshifted Relative Card Address
extern bool _SCSD_writeData_s (u8 *data, u16* crc);
static inline void _SCSD_unlock (void) {
- _SC_changeMode (SC_MODE_MEDIA);
+ _SC_changeMode (SC_MODE_MEDIA);
}
static inline void _SCSD_enable_lite (void) {
@@ -115,11 +115,11 @@ static bool _SCSD_sendCommand (u8 command, u32 argument) {
if (i == 0) {
return false;
}
-
+
dataByte = REG_SCSD_CMD;
tempDataPtr = databuff;
-
+
while (length--) {
dataByte = *tempDataPtr++;
for (curBit = 7; curBit >=0; curBit--){
@@ -127,30 +127,30 @@ static bool _SCSD_sendCommand (u8 command, u32 argument) {
dataByte = dataByte << 1;
}
}
-
+
return true;
}
// Returns the response from the SD card to a previous command.
static bool _SCSD_getResponse (u8* dest, u32 length) {
- u32 i;
+ u32 i;
int dataByte;
int numBits = length * 8;
-
+
// Wait for the card to be non-busy
i = BUSY_WAIT_TIMEOUT;
while (((REG_SCSD_CMD & 0x01) != 0) && (--i));
if (dest == NULL) {
return true;
}
-
+
if (i == 0) {
// Still busy after the timeout has passed
return false;
}
-
+
// The first bit is always 0
- dataByte = 0;
+ dataByte = 0;
numBits--;
// Read the remaining bits in the response.
// It's always most significant bit first
@@ -167,7 +167,7 @@ static bool _SCSD_getResponse (u8* dest, u32 length) {
for (i = 0; i < 16; i++) {
dataByte = REG_SCSD_CMD;
}
-
+
return true;
}
@@ -211,22 +211,22 @@ bool _SCSD_cmd_17byte_response (u8* responseBuffer, u8 command, u32 data) {
static bool _SCSD_initCard (void) {
_SCSD_enable_lite();
-
+
// Give the card time to stabilise
_SCSD_sendClocks (NUM_STARTUP_CLOCKS);
-
+
// Reset the card
if (!_SCSD_sendCommand (GO_IDLE_STATE, 0)) {
return false;
}
_SCSD_sendClocks (NUM_STARTUP_CLOCKS);
-
+
// Card is now reset, including it's address
_SCSD_relativeCardAddress = 0;
// Init the card
- return _SD_InitCard (_SCSD_cmd_6byte_response,
+ return _SD_InitCard (_SCSD_cmd_6byte_response,
_SCSD_cmd_17byte_response,
true,
&_SCSD_relativeCardAddress);
@@ -237,7 +237,7 @@ static bool _SCSD_readData (void* buffer) {
u16* buff = (u16*)buffer;
volatile register u32 temp;
int i;
-
+
i = BUSY_WAIT_TIMEOUT;
while ((REG_SCSD_DATAREAD & SCSD_STS_BUSY) && (--i));
if (i == 0) {
@@ -256,17 +256,17 @@ static bool _SCSD_readData (void* buffer) {
while(i--) {
temp = REG_SCSD_DATAREAD_32;
temp = REG_SCSD_DATAREAD_32 >> 16;
- *buff++ = temp;
+ *buff++ = temp;
}
}
-
+
for (i = 0; i < 8; i++) {
temp = REG_SCSD_DATAREAD_32;
}
-
+
temp = REG_SCSD_DATAREAD;
-
+
return true;
}
@@ -300,7 +300,7 @@ bool _SCSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
u32 i;
u8* dest = (u8*) buffer;
u8 responseBuffer[6];
-
+
if (numSectors == 1) {
// If it's only reading one sector, use the (slightly faster) READ_SINGLE_BLOCK
if (!_SCSD_sendCommand (READ_SINGLE_BLOCK, sector * BYTES_PER_READ)) {
@@ -316,13 +316,13 @@ bool _SCSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
if (!_SCSD_sendCommand (READ_MULTIPLE_BLOCK, sector * BYTES_PER_READ)) {
return false;
}
-
+
for(i=0; i < numSectors; i++, dest+=BYTES_PER_READ) {
if (!_SCSD_readData(dest)) {
return false;
}
}
-
+
// Stop the streaming
_SCSD_sendCommand (STOP_TRANSMISSION, 0);
_SCSD_getResponse_R1b (responseBuffer);
@@ -342,7 +342,7 @@ bool _SCSD_writeSectors (u32 sector, u32 numSectors, const void* buffer) {
while (numSectors--) {
// Calculate the CRC16
_SD_CRC16 ( data, BYTES_PER_READ, (u8*)crc);
-
+
// Send write command and get a response
_SCSD_sendCommand (WRITE_BLOCK, offset);
if (!_SCSD_getResponse_R1 (responseBuffer)) {
@@ -353,13 +353,13 @@ bool _SCSD_writeSectors (u32 sector, u32 numSectors, const void* buffer) {
if (! _SCSD_writeData_s (data, crc)) {
return false;
}
-
+
// Send a few clocks to the SD card
_SCSD_sendClocks(0x10);
-
+
offset += BYTES_PER_READ;
data += BYTES_PER_READ;
-
+
// Wait until card is finished programming
i = WRITE_TIMEOUT;
responseBuffer[3] = 0;
@@ -372,7 +372,7 @@ bool _SCSD_writeSectors (u32 sector, u32 numSectors, const void* buffer) {
}
} while (((responseBuffer[3] & 0x1f) != ((SD_STATE_TRAN << 1) | READY_FOR_DATA)));
}
-
+
return true;
}
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd.h
index ba302ea8bd..25a02544df 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd.h
@@ -1,11 +1,11 @@
/*
- io_scsd.h
+ io_scsd.h
Hardware Routines for reading a Secure Digital card
using the Supercard SD
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd_s.S b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd_s.S
index 2b68d3f905..5ae8fdd2b8 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd_s.S
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_scsd_s.S
@@ -3,11 +3,11 @@
@
@ Hardware Routines for reading a Secure Digital card
@ using the SC SD
-@
+@
@ Based on code supplied by Romman
@
@ Copyright (c) 2006 Michael "Chishm" Chisholm
-@
+@
@ Redistribution and use in source and binary forms, with or without modification,
@ are permitted provided that the following conditions are met:
@
@@ -39,7 +39,7 @@
.align 4
.arm
-
+
.equ REG_SCSD_DATAWRITE, 0x09000000
.equ BYTES_PER_READ, 0x200
.equ SCSD_STS_BUSY, 0x100
@@ -50,7 +50,7 @@
@ bool _SCSD_writeData_s (u8 *data, u16* crc)
.global _SCSD_writeData_s
-
+
_SCSD_writeData_s:
stmfd r13!, {r4-r5}
mov r5, #BYTES_PER_READ
@@ -64,7 +64,7 @@ _SCSD_writeData_busy_wait:
moveq r0, #FALSE @ return false on failure
beq _SCSD_writeData_return
@ Check the busy bit of the status register
- ldrh r3, [r2]
+ ldrh r3, [r2]
tst r3, #SCSD_STS_BUSY
beq _SCSD_writeData_busy_wait
@@ -72,45 +72,45 @@ _SCSD_writeData_busy_wait:
mov r3, #0 @ start bit
strh r3,[r2]
-
+
@ Check if the data buffer is aligned on a halfword boundary
tst r0, #1
beq _SCSD_writeData_data_loop
-
+
@ Used when the source data is unaligned
_SCSD_writeData_data_loop_unaligned:
ldrb r3, [r0], #1
ldrb r4, [r0], #1
orr r3, r3, r4, lsl #8
- stmia r2, {r3-r4}
- subs r5, r5, #2
+ stmia r2, {r3-r4}
+ subs r5, r5, #2
bne _SCSD_writeData_data_loop_unaligned
b _SCSD_writeData_crc
-
+
@ Write the data to the card
@ 4 halfwords are transmitted to the Supercard at once, for timing purposes
@ Only the first halfword needs to contain data for standard SuperCards
@ For the SuperCard Lite, the data is split into 4 nibbles, one per halfword
_SCSD_writeData_data_loop:
ldrh r3, [r0], #2
-
-@ This bit added for SCLite. Notice that the shift is not the same as in
+
+@ This bit added for SCLite. Notice that the shift is not the same as in
@ the original (buggy) code supplied by Romman
add r3, r3, r3, lsl #20
mov r4, r3, lsr #8
-
- stmia r2, {r3-r4}
-
- subs r5, r5, #2
- bne _SCSD_writeData_data_loop
-
+
+ stmia r2, {r3-r4}
+
+ subs r5, r5, #2
+ bne _SCSD_writeData_data_loop
+
@ Send the data CRC
_SCSD_writeData_crc:
cmp r1, #0
movne r0, r1
movne r1, #0
movne r5, #8
- bne _SCSD_writeData_data_loop
+ bne _SCSD_writeData_data_loop
mov r3, #0xff @ end bit
strh r3, [r2]
@@ -123,16 +123,16 @@ _SCSD_writeData_finished_wait:
moveq r0, #FALSE @ return false on failure
beq _SCSD_writeData_return
@ Check the busy bit of the status register
- ldrh r3, [r2]
+ ldrh r3, [r2]
tst r3, #0x100
bne _SCSD_writeData_finished_wait
@ Send 8 more clocks, as required by the SD card
- ldmia r2, {r3-r4}
+ ldmia r2, {r3-r4}
@ return true for success
mov r0, #TRUE
-
+
_SCSD_writeData_return:
ldmfd r13!,{r4-r5}
bx r14
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sd_common.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sd_common.c
index 24f6873c3d..86dd37355b 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sd_common.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sd_common.c
@@ -5,10 +5,10 @@
Common SD card routines
- SD routines partially based on sd.s by Romman
+ SD routines partially based on sd.s by Romman
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -29,11 +29,11 @@
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
2006-08-07 - Chishm
* Moved the SD initialization to a common function
* Increased timeouts for slower cards
-
+
2006-08-08 - Chishm
* Init aborts when it doesn't get a valid response to APP_CMD - speeds up detection when no card is inserted
*/
@@ -64,10 +64,10 @@ u8 _SD_CRC7(u8* data, int cnt) {
}
crc = (crc << 1) | 1;
return(crc);
-}
+}
/*
-Calculates the CRC16 for a sector of data. Calculates it
+Calculates the CRC16 for a sector of data. Calculates it
as 4 separate lots, merged into one buffer. This is used
for 4 SD data lines, not for 1 data line alone.
*/
@@ -82,53 +82,53 @@ void _SD_CRC16 (u8* buff, int buffLength, u8* crc16buff) {
b = 0; // r4
c = 0; // r5
d = 0; // r6
-
+
buffLength = buffLength * 8;
-
-
+
+
do {
if (bitPattern & 0x80) dataByte = *buff++;
-
+
a = a << 1;
if ( a & 0x10000) a ^= crcConst;
if (dataByte & (bitPattern >> 24)) a ^= crcConst;
-
+
b = b << 1;
if (b & 0x10000) b ^= crcConst;
if (dataByte & (bitPattern >> 25)) b ^= crcConst;
-
+
c = c << 1;
if (c & 0x10000) c ^= crcConst;
if (dataByte & (bitPattern >> 26)) c ^= crcConst;
-
+
d = d << 1;
if (d & 0x10000) d ^= crcConst;
if (dataByte & (bitPattern >> 27)) d ^= crcConst;
-
+
bitPattern = (bitPattern >> 4) | (bitPattern << 28);
} while (buffLength-=4);
-
+
count = 16; // r8
-
+
do {
bitPattern = bitPattern << 4;
if (a & 0x8000) bitPattern |= 8;
if (b & 0x8000) bitPattern |= 4;
if (c & 0x8000) bitPattern |= 2;
if (d & 0x8000) bitPattern |= 1;
-
+
a = a << 1;
b = b << 1;
c = c << 1;
d = d << 1;
-
+
count--;
-
+
if (!(count & 0x01)) {
*crc16buff++ = (u8)(bitPattern & 0xff);
}
} while (count != 0);
-
+
return;
}
@@ -139,24 +139,24 @@ cmd_17byte_response: a pointer to a function that sends the SD card a command an
use4bitBus: initialise card to use a 4 bit data bus when communicating with the card
RCA: a pointer to the location to store the card's Relative Card Address, preshifted up by 16 bits.
*/
-bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
+bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
_SD_FN_CMD_17BYTE_RESPONSE cmd_17byte_response,
bool use4bitBus,
u32 *RCA)
{
u8 responseBuffer[17] = {0};
int i;
-
+
for (i = 0; i < MAX_STARTUP_TRIES ; i++) {
cmd_6byte_response (responseBuffer, APP_CMD, 0);
// Check that the card gave the correct response
if (responseBuffer[0] != APP_CMD) {
return false;
}
- if (
+ if (
cmd_6byte_response (responseBuffer, SD_APP_OP_COND, SD_OCR_VALUE) &&
((responseBuffer[1] & 0x80) != 0))
- {
+ {
// Card is ready to receive commands now
break;
}
@@ -164,10 +164,10 @@ bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
if (i >= MAX_STARTUP_TRIES) {
return false;
}
-
+
// The card's name, as assigned by the manufacturer
cmd_17byte_response (responseBuffer, ALL_SEND_CID, 0);
-
+
// Get a new address
for (i = 0; i < MAX_STARTUP_TRIES ; i++) {
cmd_6byte_response (responseBuffer, SEND_RELATIVE_ADDR, 0);
@@ -182,10 +182,10 @@ bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
// Some cards won't go to higher speeds unless they think you checked their capabilities
cmd_17byte_response (responseBuffer, SEND_CSD, *RCA);
-
+
// Only this card should respond to all future commands
cmd_6byte_response (responseBuffer, SELECT_CARD, *RCA);
-
+
if (use4bitBus) {
// Set a 4 bit data bus
cmd_6byte_response (responseBuffer, APP_CMD, *RCA);
@@ -194,7 +194,7 @@ bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
// Use 512 byte blocks
cmd_6byte_response (responseBuffer, SET_BLOCKLEN, 512); // 512 byte blocks
-
+
// Wait until card is ready for data
i = 0;
do {
@@ -203,7 +203,7 @@ bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
}
i++;
} while (!cmd_6byte_response (responseBuffer, SEND_STATUS, *RCA) && ((responseBuffer[3] & 0x1f) != ((SD_STATE_TRAN << 1) | READY_FOR_DATA)));
-
+
return true;
}
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sd_common.h b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sd_common.h
index 69545a0b79..887160e293 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sd_common.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_sd_common.h
@@ -8,7 +8,7 @@
SD routines partially based on sd.s by Romman
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -32,10 +32,10 @@
2006-07-11 - Chishm
* Original release
-
+
2006-07-28 - Chishm
* Changed voltage range that the SD card can use
-
+
2006-11-14 - Chishm
* Reduced voltage range again. Hopefully fixes MicroSD cards.
*/
@@ -79,7 +79,7 @@
#define SD_STATE_IDENT 2 // Identification state, after ALL_SEND_CID
#define SD_STATE_STBY 3 // Standby state, when card is deselected
#define SD_STATE_TRAN 4 // Transfer state, after card is selected and ready for data transfer
-#define SD_STATE_DATA 5 //
+#define SD_STATE_DATA 5 //
#define SD_STATE_RCV 6 // Receive data state
#define SD_STATE_PRG 7 // Programming state
#define SD_STATE_DIS 8 // Disconnect state
@@ -88,7 +88,7 @@
#define READY_FOR_DATA 1 // bit 8 in card status
/*
-Calculate the CRC7 of a command and return it preshifted with
+Calculate the CRC7 of a command and return it preshifted with
an end bit added
*/
extern u8 _SD_CRC7(u8* data, int size);
@@ -109,7 +109,7 @@ cmd_17byte_response: a pointer to a function that sends the SD card a command an
use4bitBus: initialise card to use a 4 bit data bus when communicating with the card
RCA: a pointer to the location to store the card's Relative Card Address, preshifted up by 16 bits.
*/
-extern bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
+extern bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
_SD_FN_CMD_17BYTE_RESPONSE cmd_17byte_response,
bool use4bitBus,
u32 *RCA);
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/fatdir.c b/c/src/lib/libbsp/arm/nds/libfat/source/fatdir.c
index 2a24ef4783..78a2b14f9e 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/fatdir.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/fatdir.c
@@ -1,11 +1,11 @@
/*
fatdir.c
-
- Functions used by the newlib disc stubs to interface with
+
+ Functions used by the newlib disc stubs to interface with
this library
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -30,16 +30,16 @@
2006-08-13 - Chishm
* Moved all externally visible directory related functions to fatdir
* Added _FAT_mkdir_r
-
+
2006-08-14 - Chishm
* Added directory iterator functions
2006-08-19 - Chishm
* Updated dirnext return values to return correctly
-
+
2006-10-01 - Chishm
* Now clears the whole cluster when creating a new directory, bug found by Hermes
-
+
2007-01-10 - Chishm
* Updated directory iterator functions for DevkitPro r20
*/
@@ -62,12 +62,12 @@
int _FAT_stat_r (struct _reent *r, const char *path, struct stat *st) {
PARTITION* partition = NULL;
-
+
DIR_ENTRY dirEntry;
-
+
// Get the partition this file is on
partition = _FAT_partition_getPartitionFromPath (path);
-
+
if (partition == NULL) {
r->_errno = ENODEV;
return -1;
@@ -87,10 +87,10 @@ int _FAT_stat_r (struct _reent *r, const char *path, struct stat *st) {
r->_errno = ENOENT;
return -1;
}
-
+
// Fill in the stat struct
_FAT_directory_entryStat (partition, &dirEntry, st);
-
+
return 0;
}
@@ -106,10 +106,10 @@ int _FAT_unlink_r (struct _reent *r, const char *path) {
u32 cluster;
bool nextEntry;
bool errorOccured = false;
-
+
// Get the partition this directory is on
partition = _FAT_partition_getPartitionFromPath (path);
-
+
if (partition == NULL) {
r->_errno = ENODEV;
return -1;
@@ -119,7 +119,7 @@ int _FAT_unlink_r (struct _reent *r, const char *path) {
if (partition->readOnly) {
r->_errno = EROFS;
return -1;
- }
+ }
// Move the path pointer to the start of the actual path
if (strchr (path, ':') != NULL) {
@@ -129,20 +129,20 @@ int _FAT_unlink_r (struct _reent *r, const char *path) {
r->_errno = EINVAL;
return -1;
}
-
+
// Search for the file on the disc
if (!_FAT_directory_entryFromPath (partition, &dirEntry, path, NULL)) {
r->_errno = ENOENT;
return -1;
}
-
+
cluster = _FAT_directory_entryGetCluster (dirEntry.entryData);
-
+
// If this is a directory, make sure it is empty
if (_FAT_directory_isDirectory (&dirEntry)) {
nextEntry = _FAT_directory_getFirstEntry (partition, &dirContents, cluster);
-
+
while (nextEntry) {
if (!_FAT_directory_isDot (&dirContents)) {
// The directory had something in it that isn't a reference to itself or it's parent
@@ -166,13 +166,13 @@ int _FAT_unlink_r (struct _reent *r, const char *path) {
r->_errno = EIO;
errorOccured = true;
}
-
+
// Flush any sectors in the disc cache
if (!_FAT_cache_flush(partition->cache)) {
r->_errno = EIO;
errorOccured = true;
}
-
+
if (errorOccured) {
return -1;
} else {
@@ -182,10 +182,10 @@ int _FAT_unlink_r (struct _reent *r, const char *path) {
int _FAT_chdir_r (struct _reent *r, const char *path) {
PARTITION* partition = NULL;
-
+
// Get the partition this directory is on
partition = _FAT_partition_getPartitionFromPath (path);
-
+
if (partition == NULL) {
r->_errno = ENODEV;
return -1;
@@ -199,7 +199,7 @@ int _FAT_chdir_r (struct _reent *r, const char *path) {
r->_errno = EINVAL;
return -1;
}
-
+
// Set the default device to match this one
if (!_FAT_partition_setDefaultPartition (partition)) {
r->_errno = ENOENT;
@@ -223,15 +223,15 @@ int _FAT_rename_r (struct _reent *r, const char *oldName, const char *newName) {
DIR_ENTRY newDirEntry;
const char *pathEnd;
u32 dirCluster;
-
+
// Get the partition this directory is on
partition = _FAT_partition_getPartitionFromPath (oldName);
-
+
if (partition == NULL) {
r->_errno = ENODEV;
return -1;
}
-
+
// Make sure the same partition is used for the old and new names
if (partition != _FAT_partition_getPartitionFromPath (newName)) {
r->_errno = EXDEV;
@@ -242,7 +242,7 @@ int _FAT_rename_r (struct _reent *r, const char *oldName, const char *newName) {
if (partition->readOnly) {
r->_errno = EROFS;
return -1;
- }
+ }
// Move the path pointer to the start of the actual path
if (strchr (oldName, ':') != NULL) {
@@ -265,7 +265,7 @@ int _FAT_rename_r (struct _reent *r, const char *oldName, const char *newName) {
r->_errno = ENOENT;
return -1;
}
-
+
// Make sure there is no existing file / directory with the new name
if (_FAT_directory_entryFromPath (partition, &newDirEntry, newName, NULL)) {
r->_errno = EEXIST;
@@ -273,7 +273,7 @@ int _FAT_rename_r (struct _reent *r, const char *oldName, const char *newName) {
}
// Create the new file entry
- // Get the directory it has to go in
+ // Get the directory it has to go in
pathEnd = strrchr (newName, DIR_SEPARATOR);
if (pathEnd == NULL) {
// No path was specified
@@ -294,22 +294,22 @@ int _FAT_rename_r (struct _reent *r, const char *oldName, const char *newName) {
// Copy the entry data
memcpy (&newDirEntry, &oldDirEntry, sizeof(DIR_ENTRY));
-
+
// Set the new name
strncpy (newDirEntry.filename, pathEnd, MAX_FILENAME_LENGTH - 1);
-
+
// Write the new entry
if (!_FAT_directory_addEntry (partition, &newDirEntry, dirCluster)) {
r->_errno = ENOSPC;
return -1;
}
-
+
// Remove the old entry
if (!_FAT_directory_removeEntry (partition, &oldDirEntry)) {
r->_errno = EIO;
return -1;
}
-
+
// Flush any sectors in the disc cache
if (!_FAT_cache_flush (partition->cache)) {
r->_errno = EIO;
@@ -326,9 +326,9 @@ int _FAT_mkdir_r (struct _reent *r, const char *path, int mode) {
const char* pathEnd;
u32 parentCluster, dirCluster;
u8 newEntryData[DIR_ENTRY_DATA_SIZE];
-
+
partition = _FAT_partition_getPartitionFromPath (path);
-
+
if (partition == NULL) {
r->_errno = ENODEV;
return -1;
@@ -342,23 +342,23 @@ int _FAT_mkdir_r (struct _reent *r, const char *path, int mode) {
r->_errno = EINVAL;
return -1;
}
-
+
// Search for the file/directory on the disc
fileExists = _FAT_directory_entryFromPath (partition, &dirEntry, path, NULL);
-
+
// Make sure it doesn't exist
if (fileExists) {
r->_errno = EEXIST;
return -1;
}
-
+
if (partition->readOnly) {
// We can't write to a read-only partition
r->_errno = EROFS;
return -1;
- }
-
- // Get the directory it has to go in
+ }
+
+ // Get the directory it has to go in
pathEnd = strrchr (path, DIR_SEPARATOR);
if (pathEnd == NULL) {
// No path was specified
@@ -379,15 +379,15 @@ int _FAT_mkdir_r (struct _reent *r, const char *path, int mode) {
// Create the entry data
strncpy (dirEntry.filename, pathEnd, MAX_FILENAME_LENGTH - 1);
memset (dirEntry.entryData, 0, DIR_ENTRY_DATA_SIZE);
-
+
// Set the creation time and date
dirEntry.entryData[DIR_ENTRY_cTime_ms] = 0;
u16_to_u8array (dirEntry.entryData, DIR_ENTRY_cTime, _FAT_filetime_getTimeFromRTC());
u16_to_u8array (dirEntry.entryData, DIR_ENTRY_cDate, _FAT_filetime_getDateFromRTC());
-
+
// Set the directory attribute
dirEntry.entryData[DIR_ENTRY_attributes] = ATTRIB_DIR;
-
+
// Get a cluster for the new directory
dirCluster = _FAT_fat_linkFreeClusterCleared (partition, CLUSTER_FREE);
if (dirCluster == CLUSTER_FREE) {
@@ -403,7 +403,7 @@ int _FAT_mkdir_r (struct _reent *r, const char *path, int mode) {
r->_errno = ENOSPC;
return -1;
}
-
+
// Create the dot entry within the directory
memset (newEntryData, 0, DIR_ENTRY_DATA_SIZE);
memset (newEntryData, ' ', 11);
@@ -411,19 +411,19 @@ int _FAT_mkdir_r (struct _reent *r, const char *path, int mode) {
newEntryData[DIR_ENTRY_attributes] = ATTRIB_DIR;
u16_to_u8array (newEntryData, DIR_ENTRY_cluster, dirCluster);
u16_to_u8array (newEntryData, DIR_ENTRY_clusterHigh, dirCluster >> 16);
-
+
// Write it to the directory, erasing that sector in the process
- _FAT_cache_eraseWritePartialSector ( partition->cache, newEntryData,
+ _FAT_cache_eraseWritePartialSector ( partition->cache, newEntryData,
_FAT_fat_clusterToSector (partition, dirCluster), 0, DIR_ENTRY_DATA_SIZE);
-
-
+
+
// Create the double dot entry within the directory
newEntryData[DIR_ENTRY_name + 1] = '.';
u16_to_u8array (newEntryData, DIR_ENTRY_cluster, parentCluster);
u16_to_u8array (newEntryData, DIR_ENTRY_clusterHigh, parentCluster >> 16);
// Write it to the directory
- _FAT_cache_writePartialSector ( partition->cache, newEntryData,
+ _FAT_cache_writePartialSector ( partition->cache, newEntryData,
_FAT_fat_clusterToSector (partition, dirCluster), DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE);
// Flush any sectors in the disc cache
@@ -439,7 +439,7 @@ DIR_ITER* _FAT_diropen_r(struct _reent *r, DIR_ITER *dirState, const char *path)
DIR_ENTRY dirEntry;
DIR_STATE_STRUCT* state = (DIR_STATE_STRUCT*) (dirState->dirStruct);
bool fileExists;
-
+
state->partition = _FAT_partition_getPartitionFromPath (path);
if (state->partition == NULL) {
@@ -457,12 +457,12 @@ DIR_ITER* _FAT_diropen_r(struct _reent *r, DIR_ITER *dirState, const char *path)
}
// Get the start cluster of the directory
fileExists = _FAT_directory_entryFromPath (state->partition, &dirEntry, path, NULL);
-
+
if (!fileExists) {
r->_errno = ENOENT;
return NULL;
}
-
+
// Make sure it is a directory
if (! _FAT_directory_isDirectory (&dirEntry)) {
r->_errno = ENOTDIR;
@@ -471,11 +471,11 @@ DIR_ITER* _FAT_diropen_r(struct _reent *r, DIR_ITER *dirState, const char *path)
// Save the start cluster for use when resetting the directory data
state->startCluster = _FAT_directory_entryGetCluster (dirEntry.entryData);
-
+
// Get the first entry for use with a call to dirnext
- state->validEntry =
+ state->validEntry =
_FAT_directory_getFirstEntry (state->partition, &(state->currentEntry), state->startCluster);
-
+
// We are now using this entry
state->inUse = true;
return (DIR_ITER*) state;
@@ -491,7 +491,7 @@ int _FAT_dirreset_r (struct _reent *r, DIR_ITER *dirState) {
}
// Get the first entry for use with a call to dirnext
- state->validEntry =
+ state->validEntry =
_FAT_directory_getFirstEntry (state->partition, &(state->currentEntry), state->startCluster);
return 0;
@@ -505,7 +505,7 @@ int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct
r->_errno = EBADF;
return -1;
}
-
+
// Make sure there is another file to report on
if (! state->validEntry) {
r->_errno = ENOENT;
@@ -518,9 +518,9 @@ int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct
if (filestat != NULL) {
_FAT_directory_entryStat (state->partition, &(state->currentEntry), filestat);
}
-
+
// Look for the next entry for use next time
- state->validEntry =
+ state->validEntry =
_FAT_directory_getNextEntry (state->partition, &(state->currentEntry));
return 0;
@@ -528,7 +528,7 @@ int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct
int _FAT_dirclose_r (struct _reent *r, DIR_ITER *dirState) {
DIR_STATE_STRUCT* state = (DIR_STATE_STRUCT*) (dirState->dirStruct);
-
+
// We are no longer using this entry
state->inUse = false;
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/fatdir.h b/c/src/lib/libbsp/arm/nds/libfat/source/fatdir.h
index 5ad7b3bf84..48d0cdf0dd 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/fatdir.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/fatdir.h
@@ -1,11 +1,11 @@
/*
fatdir.h
-
- Functions used by the newlib disc stubs to interface with
+
+ Functions used by the newlib disc stubs to interface with
this library
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -30,10 +30,10 @@
2006-08-13 - Chishm
* Moved all externally visible directory related functions to fatdir
* Added _FAT_mkdir_r
-
+
2006-08-14 - Chishm
* Added directory iterator functions
-
+
2007-01-10 - Chishm
* Updated directory iterator functions for DevkitPro r20
*/
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/fatfile.c b/c/src/lib/libbsp/arm/nds/libfat/source/fatfile.c
index c4c345d9e4..17151ab6fa 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/fatfile.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/fatfile.c
@@ -1,11 +1,11 @@
/*
fatfile.c
-
- Functions used by the newlib disc stubs to interface with
+
+ Functions used by the newlib disc stubs to interface with
this library
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -29,11 +29,11 @@
2006-07-11 - Chishm
* Original release
-
+
2006-07-17 - Chishm
* Made all path inputs const char*
* Added _FAT_rename_r
-
+
2006-08-02 - Chishm
* Fixed _FAT_seek_r
@@ -63,7 +63,7 @@ int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags
u32 dirCluster;
FILE_STRUCT* file = (FILE_STRUCT*) fileStruct;
partition = _FAT_partition_getPartitionFromPath (path);
-
+
if (partition == NULL) {
r->_errno = ENODEV;
return -1;
@@ -77,7 +77,7 @@ int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags
r->_errno = EINVAL;
return -1;
}
-
+
// Determine which mode the file is openned for
if ((flags & 0x03) == O_RDONLY) {
// Open the file for read-only access
@@ -97,24 +97,24 @@ int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags
} else {
r->_errno = EACCES;
return -1;
- }
+ }
// Make sure we aren't trying to write to a read-only disc
if (file->write && partition->readOnly) {
r->_errno = EROFS;
return -1;
- }
+ }
// Search for the file on the disc
fileExists = _FAT_directory_entryFromPath (partition, &dirEntry, path, NULL);
-
+
// The file shouldn't exist if we are trying to create it
if ((flags & O_CREAT) && (flags & O_EXCL) && fileExists) {
r->_errno = EEXIST;
return -1;
}
-
- // It should not be a directory if we're openning a file,
+
+ // It should not be a directory if we're openning a file,
if (fileExists && _FAT_directory_isDirectory(&dirEntry)) {
r->_errno = EISDIR;
return -1;
@@ -127,9 +127,9 @@ int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags
// We can't write to a read-only partition
r->_errno = EROFS;
return -1;
- }
+ }
// Create the file
- // Get the directory it has to go in
+ // Get the directory it has to go in
pathEnd = strrchr (path, DIR_SEPARATOR);
if (pathEnd == NULL) {
// No path was specified
@@ -150,12 +150,12 @@ int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags
// Create the entry data
strncpy (dirEntry.filename, pathEnd, MAX_FILENAME_LENGTH - 1);
memset (dirEntry.entryData, 0, DIR_ENTRY_DATA_SIZE);
-
+
// Set the creation time and date
dirEntry.entryData[DIR_ENTRY_cTime_ms] = 0;
u16_to_u8array (dirEntry.entryData, DIR_ENTRY_cTime, _FAT_filetime_getTimeFromRTC());
u16_to_u8array (dirEntry.entryData, DIR_ENTRY_cDate, _FAT_filetime_getDateFromRTC());
-
+
if (!_FAT_directory_addEntry (partition, &dirEntry, dirCluster)) {
r->_errno = ENOSPC;
return -1;
@@ -166,9 +166,9 @@ int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags
return -1;
}
}
-
+
file->filesize = u8array_to_u32 (dirEntry.entryData, DIR_ENTRY_fileSize);
-
+
/* Allow LARGEFILEs with undefined results
// Make sure that the file size can fit in the available space
if (!(flags & O_LARGEFILE) && (file->filesize >= (1<<31))) {
@@ -176,16 +176,16 @@ int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags
return -1;
}
*/
-
+
// Make sure we aren't trying to write to a read-only file
if (file->write && !_FAT_directory_isWritable(&dirEntry)) {
r->_errno = EROFS;
return -1;
- }
+ }
// Associate this file with a particular partition
file->partition = partition;
-
+
file->startCluster = _FAT_directory_entryGetCluster (dirEntry.entryData);
// Truncate the file if requested
@@ -199,21 +199,21 @@ int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags
if (file->startCluster == 0) {
file->startCluster = _FAT_fat_linkFreeCluster (partition, CLUSTER_FREE);
}
-
+
// Remember the position of this file's directory entry
file->dirEntryStart = dirEntry.dataStart; // Points to the start of the LFN entries of a file, or the alias for no LFN
- file->dirEntryEnd = dirEntry.dataEnd;
-
+ file->dirEntryEnd = dirEntry.dataEnd;
+
file->currentPosition = 0;
-
+
file->rwPosition.cluster = file->startCluster;
file->rwPosition.sector = 0;
file->rwPosition.byte = 0;
-
+
file->appendPosition.cluster = _FAT_fat_lastCluster (partition, file->startCluster);
file->appendPosition.sector = (file->filesize % partition->bytesPerCluster) / BYTES_PER_READ;
file->appendPosition.byte = file->filesize % BYTES_PER_READ;
-
+
// Check if the end of the file is on the end of a cluster
if ( (file->filesize > 0) && ((file->filesize % partition->bytesPerCluster)==0) ){
// Set flag to allocate a new cluster
@@ -224,32 +224,32 @@ int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags
if (flags & O_APPEND) {
file->append = true;
}
-
+
file->inUse = true;
-
+
partition->openFileCount += 1;
-
+
return (int) file;
}
int _FAT_close_r (struct _reent *r, int fd) {
FILE_STRUCT* file = (FILE_STRUCT*) fd;
u8 dirEntryData[DIR_ENTRY_DATA_SIZE];
-
+
if (!file->inUse) {
r->_errno = EBADF;
return -1;
}
if (file->write) {
// Load the old entry
- _FAT_cache_readPartialSector (file->partition->cache, dirEntryData,
+ _FAT_cache_readPartialSector (file->partition->cache, dirEntryData,
_FAT_fat_clusterToSector(file->partition, file->dirEntryEnd.cluster) + file->dirEntryEnd.sector,
file->dirEntryEnd.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE);
// Write new data to the directory entry
// File size
u32_to_u8array (dirEntryData, DIR_ENTRY_fileSize, file->filesize);
-
+
// Start cluster
u16_to_u8array (dirEntryData, DIR_ENTRY_cluster, file->startCluster);
u16_to_u8array (dirEntryData, DIR_ENTRY_clusterHigh, file->startCluster >> 16);
@@ -257,12 +257,12 @@ int _FAT_close_r (struct _reent *r, int fd) {
// Modification time and date
u16_to_u8array (dirEntryData, DIR_ENTRY_mTime, _FAT_filetime_getTimeFromRTC());
u16_to_u8array (dirEntryData, DIR_ENTRY_mDate, _FAT_filetime_getDateFromRTC());
-
+
// Access date
u16_to_u8array (dirEntryData, DIR_ENTRY_aDate, _FAT_filetime_getDateFromRTC());
// Write the new entry
- _FAT_cache_writePartialSector (file->partition->cache, dirEntryData,
+ _FAT_cache_writePartialSector (file->partition->cache, dirEntryData,
_FAT_fat_clusterToSector(file->partition, file->dirEntryEnd.cluster) + file->dirEntryEnd.sector,
file->dirEntryEnd.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE);
@@ -272,22 +272,22 @@ int _FAT_close_r (struct _reent *r, int fd) {
return -1;
}
}
-
- file->inUse = false;
+
+ file->inUse = false;
file->partition->openFileCount -= 1;
-
+
return 0;
}
int _FAT_read_r (struct _reent *r, int fd, char *ptr, int len) {
FILE_STRUCT* file = (FILE_STRUCT*) fd;
-
+
PARTITION* partition;
CACHE* cache;
-
+
FILE_POSITION position;
u32 tempNextCluster;
-
+
int tempVar;
u32 remain;
@@ -304,7 +304,7 @@ int _FAT_read_r (struct _reent *r, int fd, char *ptr, int len) {
if (file->currentPosition >= file->filesize) {
return 0;
}
-
+
// Don't read past end of file
if (len + file->currentPosition > file->filesize) {
r->_errno = EOVERFLOW;
@@ -314,7 +314,7 @@ int _FAT_read_r (struct _reent *r, int fd, char *ptr, int len) {
remain = len;
position = file->rwPosition;
-
+
partition = file->partition;
cache = file->partition->cache;
@@ -324,11 +324,11 @@ int _FAT_read_r (struct _reent *r, int fd, char *ptr, int len) {
tempVar = remain;
}
- if ((tempVar < BYTES_PER_READ) && flagNoError)
+ if ((tempVar < BYTES_PER_READ) && flagNoError)
{
_FAT_cache_readPartialSector ( cache, ptr, _FAT_fat_clusterToSector (partition, position.cluster) + position.sector,
position.byte, tempVar);
-
+
remain -= tempVar;
ptr += tempVar;
@@ -354,7 +354,7 @@ int _FAT_read_r (struct _reent *r, int fd, char *ptr, int len) {
remain -= tempVar * BYTES_PER_READ;
position.sector += tempVar;
}
-
+
// Move onto next cluster
// It should get to here without reading anything if a cluster is due to be allocated
if (position.sector >= partition->sectorsPerCluster) {
@@ -402,7 +402,7 @@ int _FAT_read_r (struct _reent *r, int fd, char *ptr, int len) {
// Last remaining sector
// Check if anything is left
if ((remain > 0) && flagNoError) {
- _FAT_cache_readPartialSector ( cache, ptr,
+ _FAT_cache_readPartialSector ( cache, ptr,
_FAT_fat_clusterToSector (partition, position.cluster) + position.sector, 0, remain);
position.byte += remain;
remain = 0;
@@ -423,37 +423,37 @@ Extend a file so that the size is the same as the rwPosition
static bool file_extend_r (struct _reent *r, FILE_STRUCT* file) {
PARTITION* partition = file->partition;
CACHE* cache = file->partition->cache;
-
+
FILE_POSITION position;
-
+
u32 remain;
-
- u8 zeroBuffer [BYTES_PER_READ] = {0};
-
+
+ u8 zeroBuffer [BYTES_PER_READ] = {0};
+
u32 tempNextCluster;
-
+
position.byte = file->filesize % BYTES_PER_READ;
position.sector = (file->filesize % partition->bytesPerCluster) / BYTES_PER_READ;
position.cluster = _FAT_fat_lastCluster (partition, file->startCluster);
-
+
remain = file->currentPosition - file->filesize;
-
-
+
+
// Only need to clear to the end of the sector
if (remain + position.byte < BYTES_PER_READ) {
- _FAT_cache_writePartialSector (cache, zeroBuffer,
+ _FAT_cache_writePartialSector (cache, zeroBuffer,
_FAT_fat_clusterToSector (partition, position.cluster) + position.sector, position.byte, remain);
position.byte += remain;
} else {
if (position.byte > 0) {
- _FAT_cache_writePartialSector (cache, zeroBuffer,
+ _FAT_cache_writePartialSector (cache, zeroBuffer,
_FAT_fat_clusterToSector (partition, position.cluster) + position.sector, position.byte,
BYTES_PER_READ - position.byte);
remain -= (BYTES_PER_READ - position.byte);
position.byte = 0;
position.sector ++;
}
-
+
while (remain >= BYTES_PER_READ) {
if (position.sector >= partition->sectorsPerCluster) {
position.sector = 0;
@@ -461,7 +461,7 @@ static bool file_extend_r (struct _reent *r, FILE_STRUCT* file) {
if ((tempNextCluster == CLUSTER_EOF) || (tempNextCluster == CLUSTER_FREE)) {
// Ran out of clusters so get a new one
tempNextCluster = _FAT_fat_linkFreeCluster(partition, position.cluster);
- }
+ }
if (tempNextCluster == CLUSTER_FREE) {
// Couldn't get a cluster, so abort
r->_errno = ENOSPC;
@@ -470,21 +470,21 @@ static bool file_extend_r (struct _reent *r, FILE_STRUCT* file) {
position.cluster = tempNextCluster;
}
}
-
- _FAT_disc_writeSectors (partition->disc,
+
+ _FAT_disc_writeSectors (partition->disc,
_FAT_fat_clusterToSector (partition, position.cluster) + position.sector, 1, zeroBuffer);
-
+
remain -= BYTES_PER_READ;
position.sector ++;
}
-
+
if (position.sector >= partition->sectorsPerCluster) {
position.sector = 0;
tempNextCluster = _FAT_fat_nextCluster(partition, position.cluster);
if ((tempNextCluster == CLUSTER_EOF) || (tempNextCluster == CLUSTER_FREE)) {
// Ran out of clusters so get a new one
tempNextCluster = _FAT_fat_linkFreeCluster(partition, position.cluster);
- }
+ }
if (tempNextCluster == CLUSTER_FREE) {
// Couldn't get a cluster, so abort
r->_errno = ENOSPC;
@@ -493,14 +493,14 @@ static bool file_extend_r (struct _reent *r, FILE_STRUCT* file) {
position.cluster = tempNextCluster;
}
}
-
+
if (remain > 0) {
- _FAT_cache_writePartialSector (cache, zeroBuffer,
+ _FAT_cache_writePartialSector (cache, zeroBuffer,
_FAT_fat_clusterToSector (partition, position.cluster) + position.sector, 0, remain);
position.byte = remain;
}
}
-
+
file->rwPosition = position;
file->filesize = file->currentPosition;
return true;
@@ -509,13 +509,13 @@ static bool file_extend_r (struct _reent *r, FILE_STRUCT* file) {
int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
FILE_STRUCT* file = (FILE_STRUCT*) fd;
-
+
PARTITION* partition;
CACHE* cache;
-
+
FILE_POSITION position;
u32 tempNextCluster;
-
+
int tempVar;
u32 remain;
@@ -528,7 +528,7 @@ int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
r->_errno = EBADF;
return -1;
}
-
+
partition = file->partition;
cache = file->partition->cache;
remain = len;
@@ -543,16 +543,16 @@ int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
return 0;
}
}
-
+
// Write at current read pointer
position = file->rwPosition;
-
+
// If it is writing past the current end of file, set appending flag
if (len + file->currentPosition > file->filesize) {
flagAppending = true;
}
}
-
+
// Move onto next cluster if needed
if (position.sector >= partition->sectorsPerCluster) {
position.sector = 0;
@@ -560,7 +560,7 @@ int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
if ((tempNextCluster == CLUSTER_EOF) || (tempNextCluster == CLUSTER_FREE)) {
// Ran out of clusters so get a new one
tempNextCluster = _FAT_fat_linkFreeCluster(partition, position.cluster);
- }
+ }
if (tempNextCluster == CLUSTER_FREE) {
// Couldn't get a cluster, so abort
r->_errno = ENOSPC;
@@ -569,7 +569,7 @@ int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
position.cluster = tempNextCluster;
}
}
-
+
// Align to sector
tempVar = BYTES_PER_READ - position.byte;
if (tempVar > remain) {
@@ -578,14 +578,14 @@ int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
if ((tempVar < BYTES_PER_READ) && flagNoError) {
// Write partial sector to disk
- _FAT_cache_writePartialSector (cache, ptr,
+ _FAT_cache_writePartialSector (cache, ptr,
_FAT_fat_clusterToSector (partition, position.cluster) + position.sector, position.byte, tempVar);
remain -= tempVar;
ptr += tempVar;
position.byte += tempVar;
-
+
// Move onto next sector
if (position.byte >= BYTES_PER_READ) {
position.byte = 0;
@@ -602,7 +602,7 @@ int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
}
if ((tempVar > 0) && flagNoError) {
- _FAT_disc_writeSectors (partition->disc,
+ _FAT_disc_writeSectors (partition->disc,
_FAT_fat_clusterToSector (partition, position.cluster) + position.sector, tempVar, ptr);
ptr += tempVar * BYTES_PER_READ;
remain -= tempVar * BYTES_PER_READ;
@@ -615,7 +615,7 @@ int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
if ((tempNextCluster == CLUSTER_EOF) || (tempNextCluster == CLUSTER_FREE)) {
// Ran out of clusters so get a new one
tempNextCluster = _FAT_fat_linkFreeCluster(partition, position.cluster);
- }
+ }
if (tempNextCluster == CLUSTER_FREE) {
// Couldn't get a cluster, so abort
r->_errno = ENOSPC;
@@ -636,7 +636,7 @@ int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
if ((tempNextCluster == CLUSTER_EOF) || (tempNextCluster == CLUSTER_FREE)) {
// Ran out of clusters so get a new one
tempNextCluster = _FAT_fat_linkFreeCluster(partition, position.cluster);
- }
+ }
if (tempNextCluster == CLUSTER_FREE) {
// Couldn't get a cluster, so abort
r->_errno = ENOSPC;
@@ -653,27 +653,27 @@ int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
// Write remaining sectors
tempVar = remain / BYTES_PER_READ; // Number of sectors left
if ((tempVar > 0) && flagNoError) {
- _FAT_disc_writeSectors (partition->disc, _FAT_fat_clusterToSector (partition, position.cluster),
+ _FAT_disc_writeSectors (partition->disc, _FAT_fat_clusterToSector (partition, position.cluster),
tempVar, ptr);
ptr += tempVar * BYTES_PER_READ;
remain -= tempVar * BYTES_PER_READ;
position.sector += tempVar;
}
-
+
// Last remaining sector
if ((remain > 0) && flagNoError) {
if (flagAppending) {
- _FAT_cache_eraseWritePartialSector ( cache, ptr,
+ _FAT_cache_eraseWritePartialSector ( cache, ptr,
_FAT_fat_clusterToSector (partition, position.cluster) + position.sector, 0, remain);
} else {
- _FAT_cache_writePartialSector ( cache, ptr,
+ _FAT_cache_writePartialSector ( cache, ptr,
_FAT_fat_clusterToSector (partition, position.cluster) + position.sector, 0, remain);
}
position.byte += remain;
remain = 0;
}
-
+
// Amount read is the originally requested amount minus stuff remaining
len = len - remain;
@@ -697,7 +697,7 @@ int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len) {
int _FAT_seek_r (struct _reent *r, int fd, int pos, int dir) {
FILE_STRUCT* file = (FILE_STRUCT*) fd;
-
+
PARTITION* partition;
u32 cluster, nextCluster;
@@ -726,7 +726,7 @@ int _FAT_seek_r (struct _reent *r, int fd, int pos, int dir) {
r->_errno = EINVAL;
return -1;
}
-
+
if ((pos > 0) && (position < 0)) {
r->_errno = EOVERFLOW;
return -1;
@@ -736,15 +736,15 @@ int _FAT_seek_r (struct _reent *r, int fd, int pos, int dir) {
r->_errno = EINVAL;
return -1;
}
-
+
// Only change the read/write position if it is within the bounds of the current filesize
if (file->filesize > position) {
-
+
// Calculate the sector and byte of the current position,
// and store them
file->rwPosition.sector = (position % partition->bytesPerCluster) / BYTES_PER_READ;
file->rwPosition.byte = position % BYTES_PER_READ;
-
+
// Calculate where the correct cluster is
if (position >= file->currentPosition) {
clusCount = (position / partition->bytesPerCluster) - (file->currentPosition / partition->bytesPerCluster);
@@ -753,27 +753,27 @@ int _FAT_seek_r (struct _reent *r, int fd, int pos, int dir) {
clusCount = position / partition->bytesPerCluster;
cluster = file->startCluster;
}
-
+
nextCluster = _FAT_fat_nextCluster (partition, cluster);
while ((clusCount > 0) && (nextCluster != CLUSTER_FREE) && (nextCluster != CLUSTER_EOF)) {
clusCount--;
cluster = nextCluster;
nextCluster = _FAT_fat_nextCluster (partition, cluster);
}
-
+
// Check if ran out of clusters, and the file is being written to
if ((clusCount > 0) && (file->write || file->append)) {
// Set flag to allocate a new cluster
file->rwPosition.sector = partition->sectorsPerCluster;
file->rwPosition.byte = 0;
}
-
+
file->rwPosition.cluster = cluster;
}
-
+
// Save position
file->currentPosition = position;
-
+
return position;
}
@@ -781,9 +781,9 @@ int _FAT_seek_r (struct _reent *r, int fd, int pos, int dir) {
int _FAT_fstat_r (struct _reent *r, int fd, struct stat *st) {
FILE_STRUCT* file = (FILE_STRUCT*) fd;
-
+
PARTITION* partition;
-
+
DIR_ENTRY fileEntry;
if ((file == NULL) || (file->inUse == false)) {
@@ -793,11 +793,11 @@ int _FAT_fstat_r (struct _reent *r, int fd, struct stat *st) {
}
partition = file->partition;
-
+
// Get the file's entry data
fileEntry.dataStart = file->dirEntryStart;
fileEntry.dataEnd = file->dirEntryEnd;
-
+
if (!_FAT_directory_entryFromPosition (partition, &fileEntry)) {
r->_errno = EIO;
return -1;
@@ -805,11 +805,11 @@ int _FAT_fstat_r (struct _reent *r, int fd, struct stat *st) {
// Fill in the stat struct
_FAT_directory_entryStat (partition, &fileEntry, st);
-
+
// Fix stats that have changed since the file was openned
st->st_ino = (ino_t)(file->startCluster); // The file serial number is the start cluster
- st->st_size = file->filesize; // File size
-
+ st->st_size = file->filesize; // File size
+
return 0;
}
-
+
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/fatfile.h b/c/src/lib/libbsp/arm/nds/libfat/source/fatfile.h
index 47910afcff..2258045d7a 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/fatfile.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/fatfile.h
@@ -1,11 +1,11 @@
/*
fatfile.h
-
- Functions used by the newlib disc stubs to interface with
+
+ Functions used by the newlib disc stubs to interface with
this library
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -29,11 +29,11 @@
2006-07-11 - Chishm
* Original release
-
+
2006-07-17 - Chishm
* Made all path inputs const char*
* Added _FAT_rename_r
-
+
2006-07-24 - Chishm
* Removed padding workaround from FILE_STRUCT
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/file_allocation_table.c b/c/src/lib/libbsp/arm/nds/libfat/source/file_allocation_table.c
index ad5ffd5209..f85ec3b196 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/file_allocation_table.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/file_allocation_table.c
@@ -4,7 +4,7 @@
a FAT partition
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -28,10 +28,10 @@
2006-07-11 - Chishm
* Original release
-
+
2006-07-11 - Chishm
* Made several fixes related to free clusters, thanks to Loopy
-
+
2006-10-01 - Chishm
* Added _FAT_fat_linkFreeClusterCleared to clear a cluster when it is allocated
*/
@@ -49,13 +49,13 @@ u32 _FAT_fat_nextCluster(PARTITION* partition, u32 cluster)
u32 nextCluster = CLUSTER_FREE;
u32 sector;
int offset;
-
- switch (partition->filesysType)
+
+ switch (partition->filesysType)
{
case FS_UNKNOWN:
nextCluster = CLUSTER_FREE;
break;
-
+
case FS_FAT12:
sector = partition->fat.fatStart + (((cluster * 3) / 2) / BYTES_PER_READ);
offset = ((cluster * 3) / 2) % BYTES_PER_READ;
@@ -64,61 +64,61 @@ u32 _FAT_fat_nextCluster(PARTITION* partition, u32 cluster)
_FAT_cache_readPartialSector (partition->cache, &nextCluster, sector, offset, sizeof(u8));
offset++;
-
+
if (offset >= BYTES_PER_READ) {
offset = 0;
sector++;
}
-
+
_FAT_cache_readPartialSector (partition->cache, ((u8*)&nextCluster) + sizeof(u8), sector, offset, sizeof(u8));
-
+
if (cluster & 0x01) {
nextCluster = nextCluster >> 4;
} else {
nextCluster &= 0x0FFF;
}
-
+
if (nextCluster >= 0x0FF7)
{
nextCluster = CLUSTER_EOF;
}
break;
-
+
case FS_FAT16:
sector = partition->fat.fatStart + ((cluster << 1) / BYTES_PER_READ);
offset = (cluster % (BYTES_PER_READ >> 1)) << 1;
-
+
_FAT_cache_readPartialSector (partition->cache, &nextCluster, sector, offset, sizeof(u16));
-
+
if (nextCluster >= 0xFFF7)
{
nextCluster = CLUSTER_EOF;
}
break;
-
+
case FS_FAT32:
sector = partition->fat.fatStart + ((cluster << 2) / BYTES_PER_READ);
offset = (cluster % (BYTES_PER_READ >> 2)) << 2;
-
+
_FAT_cache_readPartialSector (partition->cache, &nextCluster, sector, offset, sizeof(u32));
-
+
if (nextCluster >= 0x0FFFFFF7)
{
nextCluster = CLUSTER_EOF;
}
break;
-
+
default:
nextCluster = CLUSTER_FREE;
break;
}
-
+
return nextCluster;
}
/*
-writes value into the correct offset within a partition's FAT, based
+writes value into the correct offset within a partition's FAT, based
on the cluster number.
*/
static bool _FAT_fat_writeFatEntry (PARTITION* partition, u32 cluster, u32 value) {
@@ -130,13 +130,13 @@ static bool _FAT_fat_writeFatEntry (PARTITION* partition, u32 cluster, u32 value
{
return false;
}
-
- switch (partition->filesysType)
+
+ switch (partition->filesysType)
{
case FS_UNKNOWN:
return false;
break;
-
+
case FS_FAT12:
sector = partition->fat.fatStart + (((cluster * 3) / 2) / BYTES_PER_READ);
offset = ((cluster * 3) / 2) % BYTES_PER_READ;
@@ -158,15 +158,15 @@ static bool _FAT_fat_writeFatEntry (PARTITION* partition, u32 cluster, u32 value
_FAT_cache_writePartialSector (partition->cache, ((u8*)&value) + sizeof(u8), sector, offset, sizeof(u8));
} else {
-
+
_FAT_cache_writePartialSector (partition->cache, &value, sector, offset, sizeof(u8));
-
+
offset++;
if (offset >= BYTES_PER_READ) {
offset = 0;
sector++;
}
-
+
_FAT_cache_readPartialSector (partition->cache, &oldValue, sector, offset, sizeof(u8));
value = ((value >> 8) & 0x0F) | (oldValue & 0xF0);
@@ -175,34 +175,34 @@ static bool _FAT_fat_writeFatEntry (PARTITION* partition, u32 cluster, u32 value
}
break;
-
+
case FS_FAT16:
sector = partition->fat.fatStart + ((cluster << 1) / BYTES_PER_READ);
- offset = (cluster % (BYTES_PER_READ >> 1)) << 1;
+ offset = (cluster % (BYTES_PER_READ >> 1)) << 1;
_FAT_cache_writePartialSector (partition->cache, &value, sector, offset, sizeof(u16));
break;
-
+
case FS_FAT32:
sector = partition->fat.fatStart + ((cluster << 2) / BYTES_PER_READ);
offset = (cluster % (BYTES_PER_READ >> 2)) << 2;
-
+
_FAT_cache_writePartialSector (partition->cache, &value, sector, offset, sizeof(u32));
break;
-
+
default:
return false;
break;
}
-
+
return true;
}
/*-----------------------------------------------------------------
gets the first available free cluster, sets it
-to end of file, links the input cluster to it then returns the
+to end of file, links the input cluster to it then returns the
cluster number
If an error occurs, return CLUSTER_FREE
-----------------------------------------------------------------*/
@@ -223,7 +223,7 @@ u32 _FAT_fat_linkFreeCluster(PARTITION* partition, u32 cluster) {
if ((curLink >= CLUSTER_FIRST) && (curLink <= lastCluster)) {
return curLink; // Return the current link - don't allocate a new one
}
-
+
// Get a free cluster
firstFree = partition->fat.firstFree;
// Start at first valid cluster
@@ -270,7 +270,7 @@ u32 _FAT_fat_linkFreeClusterCleared (PARTITION* partition, u32 cluster) {
u32 newCluster;
int i;
u8 emptySector[BYTES_PER_READ];
-
+
// Link the cluster
newCluster = _FAT_fat_linkFreeCluster(partition, cluster);
@@ -281,14 +281,14 @@ u32 _FAT_fat_linkFreeClusterCleared (PARTITION* partition, u32 cluster) {
// Clear all the sectors within the cluster
memset (emptySector, 0, BYTES_PER_READ);
for (i = 0; i < partition->sectorsPerCluster; i++) {
- _FAT_disc_writeSectors (partition->disc,
+ _FAT_disc_writeSectors (partition->disc,
_FAT_fat_clusterToSector (partition, newCluster) + i,
1, emptySector);
}
-
+
return newCluster;
}
-
+
/*-----------------------------------------------------------------
_FAT_fat_clearLinks
@@ -296,10 +296,10 @@ frees any cluster used by a file
-----------------------------------------------------------------*/
bool _FAT_fat_clearLinks (PARTITION* partition, u32 cluster) {
u32 nextCluster;
-
+
if ((cluster < 0x0002) || (cluster > partition->fat.lastCluster))
return false;
-
+
// If this clears up more space in the FAT before the current free pointer, move it backwards
if (cluster < partition->fat.firstFree) {
partition->fat.firstFree = cluster;
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/file_allocation_table.h b/c/src/lib/libbsp/arm/nds/libfat/source/file_allocation_table.h
index f67ab10472..21ed549e7e 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/file_allocation_table.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/file_allocation_table.h
@@ -4,7 +4,7 @@
a FAT partition
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/filetime.c b/c/src/lib/libbsp/arm/nds/libfat/source/filetime.c
index 1dc545d960..4619225d71 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/filetime.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/filetime.c
@@ -3,7 +3,7 @@
Conversion of file time and date values to various other types
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -27,11 +27,11 @@
2006-07-11 - Chishm
* Original release
-
+
2006-09-30 - Chishm
* Validity checks performed on the time supplied by the IPC
* Cleaned up magic numbers
-
+
2006-10-01 - Chishm
* Fixed incorrect use of bitwise-or instead of logical-or
*/
@@ -70,17 +70,17 @@ u16 _FAT_filetime_getTimeFromRTC (void) {
hour = (IPC->time.rtc.hours >= HOUR_PM_INDICATOR ? IPC->time.rtc.hours - HOUR_PM_INDICATOR : IPC->time.rtc.hours);
minute = IPC->time.rtc.minutes;
second = IPC->time.rtc.seconds;
-
+
// Check that the values are all in range.
// If they are not, return 0 (no timestamp)
if ((hour < 0) || (hour > MAX_HOUR)) return 0;
if ((minute < 0) || (minute > MAX_MINUTE)) return 0;
if ((second < 0) || (second > MAX_SECOND)) return 0;
-
+
return (
((hour & 0x1F) << 11) |
((minute & 0x3F) << 5) |
- ((second >> 1) & 0x1F)
+ ((second >> 1) & 0x1F)
);
#else
return 0;
@@ -91,16 +91,16 @@ u16 _FAT_filetime_getTimeFromRTC (void) {
u16 _FAT_filetime_getDateFromRTC (void) {
#ifdef NDS
int year, month, day;
-
+
year = IPC->time.rtc.year;
month = IPC->time.rtc.month;
day = IPC->time.rtc.day;
-
+
if ((year < MIN_YEAR) || (year > MAX_YEAR)) return 0;
if ((month < MIN_MONTH) || (month > MAX_MONTH)) return 0;
if ((day < MIN_DAY) || (day > MAX_DAY)) return 0;
-
- return (
+
+ return (
(((year + 20) & 0x7F) <<9) | // Adjust for MS-FAT base year (1980 vs 2000 for DS clock)
((month & 0xF) << 5) |
(day & 0x1F)
@@ -113,17 +113,17 @@ u16 _FAT_filetime_getDateFromRTC (void) {
time_t _FAT_filetime_to_time_t (u16 time, u16 date) {
int hour, minute, second;
int day, month, year;
-
+
time_t result;
-
+
hour = time >> 11;
minute = (time >> 5) & 0x3F;
second = (time & 0x1F) << 1;
-
+
day = date & 0x1F;
month = (date >> 5) & 0x0F;
year = date >> 9;
-
+
// Second values are averages, so time value won't be 100% accurate,
// but should be within the correct month.
result = second
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/filetime.h b/c/src/lib/libbsp/arm/nds/libfat/source/filetime.h
index 3ba0cf2e10..a69521b4fc 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/filetime.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/filetime.h
@@ -3,7 +3,7 @@
Conversion of file time and date values to various other types
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/libfat.c b/c/src/lib/libbsp/arm/nds/libfat/source/libfat.c
index f4321fc0d7..6b07236052 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/libfat.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/libfat.c
@@ -1,9 +1,9 @@
/*
libfat.c
Simple functionality for startup, mounting and unmounting of FAT-based devices.
-
+
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -30,13 +30,13 @@
2006-08-13 - Chishm
* Moved all externally visible directory related functions to fatdir
-
+
2006-08-14 - Chishm
* Added extended devoptab_t functions
-
+
2007-01-10 - Chishm
* fatInit now sets the correct path when setAsDefaultDevice
-
+
2007-01-11 - Chishm
* Added missing #include <unistd.h>
*/
@@ -78,11 +78,11 @@ const devoptab_t dotab_fat = {
bool fatInit (u32 cacheSize, bool setAsDefaultDevice) {
#ifdef NDS
bool slot1Device, slot2Device;
-
+
// Try mounting both slots
slot1Device = _FAT_partition_mount (PI_SLOT_1, cacheSize);
slot2Device = _FAT_partition_mount (PI_SLOT_2, cacheSize);
-
+
// Choose the default device
if (slot1Device) {
_FAT_partition_setDefaultInterface (PI_SLOT_1);
@@ -96,21 +96,21 @@ bool fatInit (u32 cacheSize, bool setAsDefaultDevice) {
bool cartSlotDevice;
cartSlotDevice = _FAT_partition_mount (PI_CART_SLOT, cacheSize);
-
+
if (cartSlotDevice) {
_FAT_partition_setDefaultInterface (PI_CART_SLOT);
} else {
return false;
- }
-
+ }
+
#endif // defined NDS
AddDevice (&dotab_fat);
-
+
if (setAsDefaultDevice) {
chdir ("fat:/");
}
-
+
return true;
}
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/mem_allocate.h b/c/src/lib/libbsp/arm/nds/libfat/source/mem_allocate.h
index 49d0c356d5..056023716e 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/mem_allocate.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/mem_allocate.h
@@ -5,7 +5,7 @@
malloc is unavailable
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/partition.c b/c/src/lib/libbsp/arm/nds/libfat/source/partition.c
index 12dab1abf2..9d3862793e 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/partition.c
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/partition.c
@@ -4,7 +4,7 @@
on various block devices.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -31,7 +31,7 @@
2006-08-10 - Chishm
* Fixed problem when openning files starting with "fat"
-
+
2006-10-28 - Chishm
* _partitions changed to _FAT_partitions to maintain the same style of naming as the functions
*/
@@ -47,7 +47,7 @@
#include "mem_allocate.h"
-/*
+/*
This device name, as known by DevKitPro
*/
const char* DEVICE_NAME = "fat";
@@ -145,7 +145,7 @@ static PARTITION* _FAT_partition_constructor ( const IO_INTERFACE* disc, u32 cac
if (i == 0x1FE) {
for (i=0x1BE; (i < 0x1FE) && (sectorBuffer[i+0x04] == 0x00); i+= 0x10);
}
-
+
// Go to first valid partition
if ( i != 0x1FE) {
// Make sure it found a partition
@@ -171,18 +171,18 @@ static PARTITION* _FAT_partition_constructor ( const IO_INTERFACE* disc, u32 cac
// Store required information about the file system
partition->fat.sectorsPerFat = u8array_to_u16(sectorBuffer, BPB_sectorsPerFAT);
if (partition->fat.sectorsPerFat == 0) {
- partition->fat.sectorsPerFat = u8array_to_u32( sectorBuffer, BPB_FAT32_sectorsPerFAT32);
+ partition->fat.sectorsPerFat = u8array_to_u32( sectorBuffer, BPB_FAT32_sectorsPerFAT32);
}
- partition->numberOfSectors = u8array_to_u16( sectorBuffer, BPB_numSectorsSmall);
+ partition->numberOfSectors = u8array_to_u16( sectorBuffer, BPB_numSectorsSmall);
if (partition->numberOfSectors == 0) {
- partition->numberOfSectors = u8array_to_u32( sectorBuffer, BPB_numSectors);
+ partition->numberOfSectors = u8array_to_u32( sectorBuffer, BPB_numSectors);
}
partition->bytesPerSector = BYTES_PER_READ; // Sector size is redefined to be 512 bytes
partition->sectorsPerCluster = sectorBuffer[BPB_sectorsPerCluster] * u8array_to_u16(sectorBuffer, BPB_bytesPerSector) / BYTES_PER_READ;
partition->bytesPerCluster = partition->bytesPerSector * partition->sectorsPerCluster;
- partition->fat.fatStart = bootSector + u8array_to_u16(sectorBuffer, BPB_reservedSectors);
+ partition->fat.fatStart = bootSector + u8array_to_u16(sectorBuffer, BPB_reservedSectors);
partition->rootDirStart = partition->fat.fatStart + (sectorBuffer[BPB_numFATs] * partition->fat.sectorsPerFat);
partition->dataStart = partition->rootDirStart + (( u8array_to_u16(sectorBuffer, BPB_rootEntries) * DIR_ENTRY_DATA_SIZE) / partition->bytesPerSector);
@@ -205,7 +205,7 @@ static PARTITION* _FAT_partition_constructor ( const IO_INTERFACE* disc, u32 cac
partition->rootDirCluster = FAT16_ROOT_DIR_CLUSTER;
} else {
// Set up for the FAT32 way
- partition->rootDirCluster = u8array_to_u32(sectorBuffer, BPB_FAT32_rootClus);
+ partition->rootDirCluster = u8array_to_u32(sectorBuffer, BPB_FAT32_rootClus);
// Check if FAT mirroring is enabled
if (!(sectorBuffer[BPB_FAT32_extFlags] & 0x80)) {
// Use the active FAT
@@ -218,10 +218,10 @@ static PARTITION* _FAT_partition_constructor ( const IO_INTERFACE* disc, u32 cac
// Set current directory to the root
partition->cwdCluster = partition->rootDirCluster;
-
+
// Check if this disc is writable, and set the readOnly property appropriately
partition->readOnly = !(_FAT_disc_features(disc) & FEATURE_MEDIUM_CANWRITE);
-
+
// There are currently no open files on this partition
partition->openFileCount = 0;
@@ -238,10 +238,10 @@ bool _FAT_partition_mount (PARTITION_INTERFACE partitionNumber, u32 cacheSize) {
#ifdef NDS
int i;
const IO_INTERFACE* disc = NULL;
-
+
if (_FAT_partitions[partitionNumber] != NULL) {
return false;
- }
+ }
switch (partitionNumber) {
case PI_SLOT_1:
@@ -263,7 +263,7 @@ bool _FAT_partition_mount (PARTITION_INTERFACE partitionNumber, u32 cacheSize) {
if (disc == NULL) {
return false;
}
-
+
// See if that disc is already in use, if so, then just copy the partition pointer
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
if ((_FAT_partitions[i] != NULL) && (_FAT_partitions[i]->disc == disc)) {
@@ -280,27 +280,27 @@ bool _FAT_partition_mount (PARTITION_INTERFACE partitionNumber, u32 cacheSize) {
#else // not defined NDS
const IO_INTERFACE* disc = NULL;
-
+
if (_FAT_partitions[partitionNumber] != NULL) {
return false;
- }
+ }
// Only ever one partition on GBA
disc = _FAT_disc_gbaSlotFindInterface ();
_FAT_partitions[partitionNumber] = _FAT_partition_constructor (disc, cacheSize);
-
+
#endif // defined NDS
return true;
}
bool _FAT_partition_mountCustomInterface (const IO_INTERFACE* device, u32 cacheSize) {
-#ifdef NDS
+#ifdef NDS
int i;
-
+
if (_FAT_partitions[PI_CUSTOM] != NULL) {
return false;
- }
+ }
if (device == NULL) {
return false;
@@ -319,11 +319,11 @@ bool _FAT_partition_mountCustomInterface (const IO_INTERFACE* device, u32 cacheS
if (_FAT_partitions[PI_CUSTOM] == NULL) {
return false;
}
-
+
#else // not defined NDS
if (_FAT_partitions[PI_CART_SLOT] != NULL) {
return false;
- }
+ }
if (device == NULL) {
return false;
@@ -331,7 +331,7 @@ bool _FAT_partition_mountCustomInterface (const IO_INTERFACE* device, u32 cacheS
// Only ever one partition on GBA
_FAT_partitions[PI_CART_SLOT] = _FAT_partition_constructor (device, cacheSize);
-
+
#endif // defined NDS
return true;
@@ -342,39 +342,39 @@ bool _FAT_partition_setDefaultInterface (PARTITION_INTERFACE partitionNumber) {
if ((partitionNumber < 1) || (partitionNumber >= MAXIMUM_PARTITIONS)) {
return false;
}
-
+
if (_FAT_partitions[partitionNumber] == NULL) {
return false;
}
-
+
_FAT_partitions[PI_DEFAULT] = _FAT_partitions[partitionNumber];
-#endif
+#endif
return true;
}
bool _FAT_partition_setDefaultPartition (PARTITION* partition) {
#ifdef NDS // Can only set the default partition when there is more than 1, so doesn't apply to GBA
int i;
-
+
if (partition == NULL) {
return false;
}
-
+
// Ensure that this device is already in the list
for (i = 1; i < MAXIMUM_PARTITIONS; i++) {
if (_FAT_partitions[i] == partition) {
break;
}
}
-
+
// It wasn't in the list, so fail
if (i == MAXIMUM_PARTITIONS) {
return false;
- }
-
+ }
+
// Change the default partition / device to this one
_FAT_partitions[PI_DEFAULT] = partition;
-
+
#endif
return true;
}
@@ -382,23 +382,23 @@ bool _FAT_partition_setDefaultPartition (PARTITION* partition) {
bool _FAT_partition_unmount (PARTITION_INTERFACE partitionNumber) {
int i;
PARTITION* partition = _FAT_partitions[partitionNumber];
-
+
if (partition == NULL) {
return false;
}
-
+
if (partition->openFileCount > 0) {
// There are still open files that need closing
return false;
}
-
+
// Remove all references to this partition
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
if (_FAT_partitions[i] == partition) {
_FAT_partitions[i] = NULL;
}
}
-
+
_FAT_partition_destructor (partition);
return true;
}
@@ -406,18 +406,18 @@ bool _FAT_partition_unmount (PARTITION_INTERFACE partitionNumber) {
bool _FAT_partition_unsafeUnmount (PARTITION_INTERFACE partitionNumber) {
int i;
PARTITION* partition = _FAT_partitions[partitionNumber];
-
+
if (partition == NULL) {
return false;
}
-
+
// Remove all references to this partition
for (i = 0; i < MAXIMUM_PARTITIONS; i++) {
if (_FAT_partitions[i] == partition) {
_FAT_partitions[i] = NULL;
}
}
-
+
_FAT_cache_invalidate (partition->cache);
_FAT_partition_destructor (partition);
return true;
@@ -427,7 +427,7 @@ PARTITION* _FAT_partition_getPartitionFromPath (const char* path) {
#ifdef NDS
int namelen;
int partitionNumber;
-
+
// Device name extraction code taken from DevKitPro
namelen = strlen(DEVICE_NAME);
if (strchr (path, ':') == NULL) {
@@ -448,11 +448,11 @@ PARTITION* _FAT_partition_getPartitionFromPath (const char* path) {
// Incorrect device name
return NULL;
}
-
+
if ((partitionNumber < 0) || (partitionNumber >= MAXIMUM_PARTITIONS)) {
return NULL;
}
-
+
return _FAT_partitions[partitionNumber];
#else // not defined NDS
// Only one possible partition on GBA
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/partition.h b/c/src/lib/libbsp/arm/nds/libfat/source/partition.h
index aed5187ade..29f06f8a76 100644
--- a/c/src/lib/libbsp/arm/nds/libfat/source/partition.h
+++ b/c/src/lib/libbsp/arm/nds/libfat/source/partition.h
@@ -4,7 +4,7 @@
on various block devices.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -109,7 +109,7 @@ based on the device number
bool _FAT_partition_setDefaultInterface (PARTITION_INTERFACE partitionNumber);
/*
-Set the default device for access by fat: and fat0:,
+Set the default device for access by fat: and fat0:,
based on the partition pointer
*/
bool _FAT_partition_setDefaultPartition (PARTITION* partition);
diff --git a/c/src/lib/libbsp/arm/nds/libnds/basicARM7/source/defaultARM7.c b/c/src/lib/libbsp/arm/nds/libnds/basicARM7/source/defaultARM7.c
index ca9d39796a..6cb092f04b 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/basicARM7/source/defaultARM7.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/basicARM7/source/defaultARM7.c
@@ -53,13 +53,13 @@ touchPosition first,tempPos;
void VcountHandler() {
//---------------------------------------------------------------------------------
static int lastbut = -1;
-
+
uint16 but=0, x=0, y=0, xpx=0, ypx=0, z1=0, z2=0;
but = REG_KEYXY;
if (!( (but ^ lastbut) & (1<<6))) {
-
+
tempPos = touchReadXY();
if ( tempPos.x == 0 || tempPos.y == 0 ) {
@@ -73,7 +73,7 @@ void VcountHandler() {
z1 = tempPos.z1;
z2 = tempPos.z2;
}
-
+
} else {
lastbut = but;
but |= (1 <<6);
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm7/audio.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm7/audio.h
index a1c6f8b777..124911e1b9 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm7/audio.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm7/audio.h
@@ -87,7 +87,7 @@ extern "C" {
/*---------------------------------------------------------------------------------
microphone code based on neimod's microphone example.
- See: http://neimod.com/dstek/
+ See: http://neimod.com/dstek/
Chris Double (chris.double@double.co.nz)
http://www.double.co.nz/nintendo_ds
---------------------------------------------------------------------------------*/
@@ -101,7 +101,7 @@ u8 MIC_ReadData();
/*---------------------------------------------------------------------------------
Fill the buffer with data from the microphone. The buffer will be
signed sound data at 16kHz. Once the length of the buffer is
- reached, no more data will be stored. Uses ARM7 timer 0.
+ reached, no more data will be stored. Uses ARM7 timer 0.
---------------------------------------------------------------------------------*/
void StartRecording(u8* buffer, int length);
@@ -116,7 +116,7 @@ void ProcessMicrophoneTimerIRQ();
void PM_SetAmp(u8 control);
//---------------------------------------------------------------------------------
-// Turn the microphone on
+// Turn the microphone on
//---------------------------------------------------------------------------------
static inline void MIC_On() {
//---------------------------------------------------------------------------------
@@ -125,7 +125,7 @@ static inline void MIC_On() {
//---------------------------------------------------------------------------------
-// Turn the microphone off
+// Turn the microphone off
//---------------------------------------------------------------------------------
static inline void MIC_Off() {
//---------------------------------------------------------------------------------
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm7/clock.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm7/clock.h
index c5a5dbc30d..7de64292b9 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm7/clock.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm7/clock.h
@@ -84,15 +84,15 @@ extern "C" {
1b Alarm 2 interrupt
7 R/W Test Mode (0=Normal, 1=Test, don't use) (cleared on Reset)
*/
-#define STATUS_TEST (1<<7) //
-#define STATUS_INT2AE (1<<6) //
+#define STATUS_TEST (1<<7) //
+#define STATUS_INT2AE (1<<6) //
#define STATUS_SC3 (1<<5) // R/W scratch bit
#define STATUS_SC2 (1<<4) // R/W scratch bit
#define STATUS_32kE (1<<3) // Interrupt mode bits
-#define STATUS_INT1AE (1<<2) //
-#define STATUS_INT1ME (1<<1) //
-#define STATUS_INT1FE (1<<0) //
+#define STATUS_INT1AE (1<<2) //
+#define STATUS_INT1ME (1<<1) //
+#define STATUS_INT1FE (1<<0) //
// full 7 bytes for time and date
#define WRITE_TIME_AND_DATE 0x64
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/boxtest.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/boxtest.h
index ee82f989e4..0ff895d351 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/boxtest.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/boxtest.h
@@ -35,10 +35,10 @@ distribution.
#include <nds/arm9/video.h>
#include <nds/arm9/videoGL.h>
-/*! \file boxtest.h
-\brief Box Test Functions.
+/*! \file boxtest.h
+\brief Box Test Functions.
-*/
+*/
#ifdef __cplusplus
extern "C" {
@@ -78,7 +78,7 @@ int BoxTestf(float x, float y, float z, float width, float height, float depth);
\param height (width, height, depth) describe the size of the box referenced from (x, y, z)
\param depth (width, height, depth) describe the size of the box referenced from (x, y, z)
-Performs a test to determine if the provided box is in the view frustum. BoxTestResult must be called to get the result of this
+Performs a test to determine if the provided box is in the view frustum. BoxTestResult must be called to get the result of this
operation.
*/
void BoxTest_Asynch(v16 x, v16 y, v16 z, v16 height, v16 width, v16 depth);
@@ -92,7 +92,7 @@ void BoxTest_Asynch(v16 x, v16 y, v16 z, v16 height, v16 width, v16 depth);
\param height (width, height, depth) describe the size of the box referenced from (x, y, z)
\param depth (width, height, depth) describe the size of the box referenced from (x, y, z)
-Performs a test to determine if the provided box is in the view frustum. BoxTestResult must be called to get the result of this
+Performs a test to determine if the provided box is in the view frustum. BoxTestResult must be called to get the result of this
operation.
*/
void BoxTestf_Asynch(float x, float y, float z, float width, float height, float depth);
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/cache.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/cache.h
index 08a6158aa7..949a45fb98 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/cache.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/cache.h
@@ -45,7 +45,7 @@ extern "C" {
*/
void IC_InvalidateAll(void);
-
+
/*! \fn IC_InvalidateRange(const void *base, u32 size)
\brief invalidate the instruction cache for a range of addresses.
\param base base address of the region to invalidate
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/console.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/console.h
index 19ac5382f9..beb87d407b 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/console.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/console.h
@@ -50,12 +50,12 @@ extern "C" {
\param charStart ascii code of the first character in the font
\param map base address of the map to use for printing
\param pal 16 color palette index to use
- \param bitDepth 256/16 color tile flag.
-
+ \param bitDepth 256/16 color tile flag.
+
Initializes the console with the given parameters. When pal is greater than 15 and
bitDepth is 16 then all non zero entries in the font are set to index 255. When bitDepth
is not 16 then the font tiles are created as 8bit (256 color).
-
+
*/
void consoleInit(u16* font, u16* charBase, u16 numCharacters, u8 charStart, u16* map, u8 pal, u8 bitDepth);
/*! \fn void consoleInitDefault(u16* map, u16* charBase, u8 bitDepth)
@@ -65,7 +65,7 @@ void consoleInit(u16* font, u16* charBase, u16 numCharacters, u8 charStart, u16*
\param bitDepth 256/16 color tile flag
This function calls consoleInit() with the default built in font and character ranges, the parameters given
- are as for that function.
+ are as for that function.
*/
void consoleInitDefault(u16* map, u16* charBase, u8 bitDepth);
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/image.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/image.h
index 3764afccb1..b57622b9f3 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/image.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/image.h
@@ -24,16 +24,154 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.5 2007/01/19 14:45:59 wntrmute
name anonymous structs and unions for -std=c99
-
+
Revision 1.4 2005/10/11 05:05:26 dovoto
Added imageTileData(sImage* img) to allow loading of pcx as sprite data.
Updated pcx.c to set image bit per pixel field
-
+
Revision 1.3 2005/08/30 17:56:21 wntrmute
add video.h
-
+
Revision 1.2 2005/08/11 14:53:00 desktopman
Added image24to16(sImage* img)
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/input.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/input.h
index 450ec80bd8..ed7531bd51 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/input.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/input.h
@@ -27,9 +27,30 @@
distribution.
$Log$
+ Revision 1.2 2008/08/20 16:31:41 joel
+ 2008-08-20 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * block/block.c, console/console.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.h, dswifi/arm9/source/sgIP_Config.h,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.h,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.h,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.h,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h, fb/fb.c,
+ include/my_ipc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_nmmc.c,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/input.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/videoGL.h, libnds/source/arm9/console.c,
+ libnds/source/arm9/gurumeditation.c, libnds/source/arm9/ndsmotion.c,
+ libnds/source/common/card.c, libnds/source/common/interrupts.c,
+ sound/sound.c, startup/start.c, touchscreen/reco.h, wifi/compat.c,
+ wifi/compat.h: Fix most warnings.
+
Revision 1.1 2008/04/16 18:37:32 joel
2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
-
+
* ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
@@ -164,44 +185,44 @@
touchscreen/reco.h, touchscreen/touchscreen.c,
touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
New files.
-
+
Revision 1.14 2006/02/25 02:18:53 wntrmute
doxygenation updates
-
+
Revision 1.13 2006/01/12 09:10:47 wntrmute
Added key repeat as suggested by pepsiman
-
+
Revision 1.12 2006/01/10 05:50:24 dovoto
uhmm...about that KEY_R vs KEY_L thing...lets pretend that never happened
-
+
Revision 1.11 2006/01/10 05:45:24 dovoto
KEY_L and KEY_R were swapped
-
+
Revision 1.10 2005/11/27 07:55:14 joatski
Fixed my mistake in the changelogs
-
+
Revision 1.9 2005/11/27 07:48:45 joatski
Changed function returns to uint32
-
+
Revision 1.8 2005/11/14 11:59:49 wntrmute
reformat for consistency
-
+
Revision 1.7 2005/11/03 23:38:49 wntrmute
don't use enum for key function returns
-
+
Revision 1.6 2005/10/18 04:17:04 wntrmute
doxygenation
-
+
Revision 1.5 2005/10/13 16:30:11 dovoto
Changed KEYPAD_BITS to a typedef enum, this resolved some issues with multiple redefinition of KEYPAD_BITS (although this error did not allways occur).
-
+
Revision 1.4 2005/10/03 21:21:21 wntrmute
doxygenation
-
+
Revision 1.3 2005/09/07 18:03:36 wntrmute
renamed key input registers
moved key bit definitions to input.h
-
+
Revision 1.2 2005/08/23 17:06:10 wntrmute
converted all endings to unix
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/math.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/math.h
index be7439c8e8..e740acb24c 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/math.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/math.h
@@ -26,12 +26,150 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.12 2007/01/14 11:31:22 wntrmute
bogus fixed types removed from libnds
-
+
Revision 1.11 2006/07/06 02:16:01 wntrmute
tidy formatting
-
+
Revision 1.10 2006/06/01 01:44:26 crossraleigh
Fixed spelling of DIV_REMAINDER
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/ndsmotion.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/ndsmotion.h
index 6335cadf35..322793c918 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/ndsmotion.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/ndsmotion.h
@@ -2,7 +2,7 @@
$Id$
DS Motion Card/DS Motion Pak functionality
-
+
Copyright (C) 2007
Michael Noland (joat)
Jason Rogers (dovoto)
@@ -28,8 +28,8 @@
---------------------------------------------------------------------------------*/
-/*! \file ndsmotion.h
-\brief interface code for the ds motion card, ds motion pak, MK6
+/*! \file ndsmotion.h
+\brief interface code for the ds motion card, ds motion pak, MK6
*/
#ifndef NDS_MOTION_INCLUDE
@@ -37,7 +37,7 @@
//---------------------------------------------------------------------------------
-typedef struct
+typedef struct
{
short xoff, yoff, zoff, goff;
short xsens, ysens, zsens, gsens;
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/pcx.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/pcx.h
index 03bab707eb..68843d4973 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/pcx.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/pcx.h
@@ -24,34 +24,172 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.3 2005/08/23 17:06:10 wntrmute
converted all endings to unix
-
+
Revision 1.2 2005/08/01 23:18:22 wntrmute
adjusted headers for logging
-
+
Revision 1.1 2005/07/27 02:20:52 wntrmute
add image functions
-
+
---------------------------------------------------------------------------------*/
#ifndef PCX_H
#define PCX_H
-
+
typedef struct
{
char manufacturer; //should be 0
- char version; //should be 5
+ char version; //should be 5
char encoding; //should be 1
char bitsPerPixel; //should be 8
short int xmin,ymin; //coordinates for top left,bottom right
- short int xmax,ymax;
+ short int xmax,ymax;
short int hres; //resolution
short int vres;
char palette16[48]; //16 color palette if 16 color image
char reserved; //ignore
char colorPlanes; //ignore
- short int bytesPerLine;
+ short int bytesPerLine;
short int paletteYype; //should be 2
char filler[58]; //ignore
}__attribute__ ((packed)) PCXHeader, *pPCXHeader;
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/postest.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/postest.h
index 022f0223a2..e08b3f4702 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/postest.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/postest.h
@@ -31,7 +31,7 @@ distribution.
#include <nds/arm9/video.h>
#include <nds/arm9/videoGL.h>
-/*! \brief true if the hardware is currently performing a position/vertex/box test.
+/*! \brief true if the hardware is currently performing a position/vertex/box test.
\return whether a test is being performed */
GL_STATIC_INL bool PosTestBusy() {
return (GFX_STATUS & BIT(0))!=0;
@@ -40,7 +40,7 @@ GL_STATIC_INL bool PosTestBusy() {
/*! \file postest.h
\brief Position Test Functions.<BR>
The position test multiplies a given vector by the position matrix and returns the coords(x,y,z,w). The position test is really quick, about 10x faster than a box test.
-*/
+*/
/*! \brief Starts a position test asynchronously
\param x specifies x offset from the current modelview matrix
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/rumble.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/rumble.h
index 2e0fb60b51..49e915dcf1 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/rumble.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/rumble.h
@@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------------
$Id$
-
+
Copyright (C) 2005
Michael Noland (joat)
Jason Rogers (dovoto)
@@ -12,7 +12,7 @@
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
-
+
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
@@ -22,13 +22,151 @@
3. This notice may not be removed or altered from any source
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.4 2007/02/07 16:38:11 wntrmute
add warioware rumble support
-
+
Revision 1.3 2005/11/27 07:47:07 joatski
Fixed multiple linebreaks.
Moved cart bus control functions and GBA header to memory.h
-
+
Revision 1.2 2005/11/02 07:06:20 bigredpimp
Added revision comment block
@@ -46,7 +184,7 @@ extern "C" {
#define RUMBLE_PAK (*(vuint16 *)0x08000000)
#define WARIOWARE_PAK (*(vuint16 *)0x080000C4)
#define WARIOWARE_ENABLE (*(vuint16 *)0x080000C6)
-
+
typedef enum {
RUMBLE,
WARIOWARE
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/sound.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/sound.h
index 63c76a78a3..43c0c5132b 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/sound.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/sound.h
@@ -24,15 +24,153 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.3 2005/08/15 03:49:25 wntrmute
export setGenericSound
-
+
Revision 1.2 2005/08/04 17:57:58 wntrmute
playSoundBlock internal only
-
+
Revision 1.1 2005/08/03 05:28:07 wntrmute
added arm9 sound functions
-
+
---------------------------------------------------------------------------------*/
#ifndef _sound_h_
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/sprite.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/sprite.h
index 7e17565080..bbfefad6a3 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/sprite.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/sprite.h
@@ -85,9 +85,9 @@ typedef enum
OBJMODE_BLENDED, /**< Color blending is on - Sprite can use HW blending features. */
OBJMODE_WINDOWED, /**< Sprite can be seen only inside the sprite window. */
OBJMODE_BITMAP, /**< Sprite is not using tiles - per pixel image data. */
-
+
} tObjMode;
-
+
/**
* @enum tObjShape
* @brief Sprite shape mode.
@@ -98,7 +98,7 @@ typedef enum {
OBJSHAPE_TALL, /**< Sprite shape is NxM with N < M (Height > Width). */
OBJSHAPE_FORBIDDEN, /**< Sprite shape is undefined. */
} tObjShape;
-
+
/**
* @enum tObjSize
* @brief Object shape mode.
@@ -134,7 +134,7 @@ typedef enum {
typedef union {
struct {
-
+
struct {
u16 posY :8; /**< Sprite Y position. */
union {
@@ -153,7 +153,7 @@ typedef union {
};
};
};
-
+
union {
struct {
u16 posX :9; /**< Sprite X position. */
@@ -176,21 +176,21 @@ typedef union {
};
};
};
-
+
struct {
u16 tileIdx :10;/**< Upper-left tile index. */
tObjPriority objPriority :2; /**< Sprite priority. */
u8 objPal :4; /**< Sprite palette to use in paletted color modes. */
};
-
+
u16 attribute3; /**< Four of those are used as a sprite rotation matrice */
};
-
+
struct {
uint16 attribute[3];
uint16 filler;
};
-
+
} SpriteEntry, * pSpriteEntry;
@@ -219,6 +219,6 @@ typedef union {
SpriteEntry spriteBuffer[SPRITE_COUNT];
SpriteRotation matrixBuffer[MATRIX_COUNT];
} tOAM;
-
+
#endif // _libnds_sprite_h_
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/trig_lut.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/trig_lut.h
index 5bf31cf818..591b68e3ab 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/trig_lut.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/trig_lut.h
@@ -26,12 +26,150 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.7 2005/08/23 17:06:10 wntrmute
converted all endings to unix
-
+
Revision 1.6 2005/08/01 23:18:22 wntrmute
adjusted headers for logging
-
+
Revision 1.5 2005/07/29 00:35:52 wntrmute
update file header
reference externs directly
@@ -51,4 +189,4 @@ extern short TAN_bin[];
#define TAN TAN_bin
-#endif
+#endif
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/video.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/video.h
index 723ca41ba0..ff8725676e 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/video.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/video.h
@@ -374,7 +374,7 @@ typedef struct {
u16 ydx;
u16 ydy;
u32 centerX;
- u32 centerY;
+ u32 centerY;
} bg_rotation;
typedef struct {
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/videoGL.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/videoGL.h
index 2e75729759..32c495a56e 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/videoGL.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/arm9/videoGL.h
@@ -29,8 +29,8 @@
---------------------------------------------------------------------------------*/
-/*! \file videoGL.h
-\brief openGL (ish) interface to DS 3D hardware.
+/*! \file videoGL.h
+\brief openGL (ish) interface to DS 3D hardware.
*/
#ifndef VIDEOGL_ARM9_INCLUDE
@@ -141,7 +141,7 @@ typedef struct {
<A HREF="http://nocash.emubase.de/gbatek.htm#ds3dpolygondefinitionsbyvertices">GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygondefinitionsbyvertices</A><BR>
related functions: glBegin() */
typedef enum {
- GL_TRIANGLES = 0, /*!< draw triangles with each 3 vertices defining a triangle */
+ GL_TRIANGLES = 0, /*!< draw triangles with each 3 vertices defining a triangle */
GL_QUADS = 1, /*!< draw quads with each 4 vertices defining a quad */
GL_TRIANGLE_STRIP = 2, /*!< draw triangles with the first triangle defined by 3 vertices, then each additional triangle being defined by one additional vertex */
GL_QUAD_STRIP = 3, /*!< draw quads with the first quad being defined by 4 vertices, then each additional triangle being defined by 2 vertices. */
@@ -193,7 +193,7 @@ enum GL_POLY_FORMAT_ENUM {
related functions: glTexImage2d(), glTexParameter() */
enum GL_TEXTURE_SIZE_ENUM {
TEXTURE_SIZE_8 = 0, /*!< 8 texels */
- TEXTURE_SIZE_16 = 1, /*!< 16 texels */
+ TEXTURE_SIZE_16 = 1, /*!< 16 texels */
TEXTURE_SIZE_32 = 2, /*!< 32 texels */
TEXTURE_SIZE_64 = 3, /*!< 64 texels */
TEXTURE_SIZE_128 = 4, /*!< 128 texels */
@@ -280,17 +280,17 @@ much about it. This is only an issue because of hte mix of inlined/real function
---------------------------------------------------------------------------------*/
typedef struct {
GL_MATRIX_MODE_ENUM matrixMode; // holds the current Matrix Mode
-
+
// holds the current state of the clear color register
uint32 clearColor; // state of clear color register
-
+
// texture globals
uint32 textures[MAX_TEXTURES];
uint32 activeTexture;
uint32* nextBlock;
uint32 nextPBlock;
int nameCount;
-
+
} gl_hidden_globals;
// Pointer to global data for videoGL
@@ -380,7 +380,7 @@ void glTexParameter( uint8 sizeX, uint8 sizeY,
/*! \brief Returns the active texture parameter (constructed from internal call to glTexParameter) */
u32 glGetTexParameter(void);
-/*! \brief returns the address alocated to the texure named by name
+/*! \brief returns the address alocated to the texure named by name
\param name the name of the texture to get a pointer to */
void* glGetTexturePointer( int name);
@@ -421,7 +421,7 @@ gl_hidden_globals* glGetGlobals(void);
#ifdef __cplusplus
}
#endif
-
+
@@ -525,7 +525,7 @@ GL_STATIC_INL void glStoreMatrix(int32 index) { MATRIX_STORE = index; }
/*! \brief multiply the current matrix by a translation matrix<BR>
<A HREF="http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply">GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply</A>
\param v the vector to translate by */
-GL_STATIC_INL void glScalev(const GLvector* v) {
+GL_STATIC_INL void glScalev(const GLvector* v) {
MATRIX_SCALE = v->x;
MATRIX_SCALE = v->y;
MATRIX_SCALE = v->z;
@@ -604,12 +604,12 @@ GL_STATIC_INL void glFlush(uint32 mode) { GFX_FLUSH = mode; }
GL_STATIC_INL void glMaterialShinyness(void) {
uint32 shiny32[128/4];
uint8 *shiny8 = (uint8*)shiny32;
-
+
int i;
-
+
for (i = 0; i < 128 * 2; i += 2)
shiny8[i>>1] = i;
-
+
for (i = 0; i < 128 / 4; i++)
GFX_SHININESS = shiny32[i];
}
@@ -621,14 +621,14 @@ There is sometimes a problem when you pack the GFX_END command into a list, so d
<A HREF="http://nocash.emubase.de/gbatek.htm#ds3dgeometrycommands">GBATEK http://nocash.emubase.de/gbatek.htm#ds3dgeometrycommands</A> */
GL_STATIC_INL void glCallList(const u32* list) {
u32 count = *list++;
-
+
// flush the area that we are going to DMA
DC_FlushRange(list, count*4);
-
+
// don't start DMAing while anything else is being DMAed because FIFO DMA is touchy as hell
// If anyone can explain this better that would be great. -- gabebear
while((DMA_CR(0) & DMA_BUSY)||(DMA_CR(1) & DMA_BUSY)||(DMA_CR(2) & DMA_BUSY)||(DMA_CR(3) & DMA_BUSY));
-
+
// send the packed list asynchronously via DMA to the FIFO
DMA_SRC(0) = (uint32)list;
DMA_DEST(0) = 0x4000400;
@@ -656,17 +656,17 @@ GL_STATIC_INL void glLoadMatrix4x4(const m4x4 *m) {
MATRIX_LOAD4x4 = m->m[1];
MATRIX_LOAD4x4 = m->m[2];
MATRIX_LOAD4x4 = m->m[3];
-
+
MATRIX_LOAD4x4 = m->m[4];
MATRIX_LOAD4x4 = m->m[5];
MATRIX_LOAD4x4 = m->m[6];
MATRIX_LOAD4x4 = m->m[7];
-
+
MATRIX_LOAD4x4 = m->m[8];
MATRIX_LOAD4x4 = m->m[9];
MATRIX_LOAD4x4 = m->m[10];
MATRIX_LOAD4x4 = m->m[11];
-
+
MATRIX_LOAD4x4 = m->m[12];
MATRIX_LOAD4x4 = m->m[13];
MATRIX_LOAD4x4 = m->m[14];
@@ -680,12 +680,12 @@ GL_STATIC_INL void glLoadMatrix4x3(const m4x3 * m) {
MATRIX_LOAD4x3 = m->m[1];
MATRIX_LOAD4x3 = m->m[2];
MATRIX_LOAD4x3 = m->m[3];
-
+
MATRIX_LOAD4x3 = m->m[4];
MATRIX_LOAD4x3 = m->m[5];
MATRIX_LOAD4x3 = m->m[6];
MATRIX_LOAD4x3 = m->m[7];
-
+
MATRIX_LOAD4x3 = m->m[8];
MATRIX_LOAD4x3 = m->m[9];
MATRIX_LOAD4x3 = m->m[10];
@@ -699,17 +699,17 @@ GL_STATIC_INL void glMultMatrix4x4(const m4x4 * m) {
MATRIX_MULT4x4 = m->m[1];
MATRIX_MULT4x4 = m->m[2];
MATRIX_MULT4x4 = m->m[3];
-
+
MATRIX_MULT4x4 = m->m[4];
MATRIX_MULT4x4 = m->m[5];
MATRIX_MULT4x4 = m->m[6];
MATRIX_MULT4x4 = m->m[7];
-
+
MATRIX_MULT4x4 = m->m[8];
MATRIX_MULT4x4 = m->m[9];
MATRIX_MULT4x4 = m->m[10];
MATRIX_MULT4x4 = m->m[11];
-
+
MATRIX_MULT4x4 = m->m[12];
MATRIX_MULT4x4 = m->m[13];
MATRIX_MULT4x4 = m->m[14];
@@ -723,17 +723,17 @@ GL_STATIC_INL void glMultMatrix4x3(const m4x3 * m) {
MATRIX_MULT4x3 = m->m[1];
MATRIX_MULT4x3 = m->m[2];
MATRIX_MULT4x3 = m->m[3];
-
+
MATRIX_MULT4x3 = m->m[4];
MATRIX_MULT4x3 = m->m[5];
MATRIX_MULT4x3 = m->m[6];
MATRIX_MULT4x3 = m->m[7];
-
+
MATRIX_MULT4x3 = m->m[8];
MATRIX_MULT4x3 = m->m[9];
MATRIX_MULT4x3 = m->m[10];
MATRIX_MULT4x3 = m->m[11];
-
+
}
/*! \brief multiplies the current matrix by m
@@ -742,68 +742,68 @@ GL_STATIC_INL void glMultMatrix3x3(const m3x3 * m) {
MATRIX_MULT3x3 = m->m[0];
MATRIX_MULT3x3 = m->m[1];
MATRIX_MULT3x3 = m->m[2];
-
+
MATRIX_MULT3x3 = m->m[3];
MATRIX_MULT3x3 = m->m[4];
MATRIX_MULT3x3 = m->m[5];
-
+
MATRIX_MULT3x3 = m->m[6];
MATRIX_MULT3x3 = m->m[7];
MATRIX_MULT3x3 = m->m[8];
}
-/*! \brief Rotates the current modelview matrix by angle about the x axis
+/*! \brief Rotates the current modelview matrix by angle about the x axis
\param angle The angle to rotate by (angle is 0-511) */
GL_STATIC_INL void glRotateXi(int angle) {
int32 sine = SIN[angle & LUT_MASK];
int32 cosine = COS[angle & LUT_MASK];
-
+
MATRIX_MULT3x3 = inttof32(1);
MATRIX_MULT3x3 = 0;
MATRIX_MULT3x3 = 0;
-
+
MATRIX_MULT3x3 = 0;
MATRIX_MULT3x3 = cosine;
MATRIX_MULT3x3 = sine;
-
+
MATRIX_MULT3x3 = 0;
MATRIX_MULT3x3 = -sine;
MATRIX_MULT3x3 = cosine;
}
-/*! \brief Rotates the current modelview matrix by angle about the y axis
+/*! \brief Rotates the current modelview matrix by angle about the y axis
\param angle The angle to rotate by (angle is 0-511) */
GL_STATIC_INL void glRotateYi(int angle) {
int32 sine = SIN[angle & LUT_MASK];
int32 cosine = COS[angle & LUT_MASK];
-
+
MATRIX_MULT3x3 = cosine;
MATRIX_MULT3x3 = 0;
MATRIX_MULT3x3 = -sine;
-
+
MATRIX_MULT3x3 = 0;
MATRIX_MULT3x3 = inttof32(1);
MATRIX_MULT3x3 = 0;
-
+
MATRIX_MULT3x3 = sine;
MATRIX_MULT3x3 = 0;
MATRIX_MULT3x3 = cosine;
}
-/*! \brief Rotates the current modelview matrix by angle about the z axis
+/*! \brief Rotates the current modelview matrix by angle about the z axis
\param angle The angle to rotate by (angle is 0-511) */
GL_STATIC_INL void glRotateZi(int angle) {
int32 sine = SIN[angle & LUT_MASK];
int32 cosine = COS[angle & LUT_MASK];
-
+
MATRIX_MULT3x3 = cosine;
MATRIX_MULT3x3 = sine;
MATRIX_MULT3x3 = 0;
-
+
MATRIX_MULT3x3 = - sine;
MATRIX_MULT3x3 = cosine;
MATRIX_MULT3x3 = 0;
-
+
MATRIX_MULT3x3 = 0;
MATRIX_MULT3x3 = 0;
MATRIX_MULT3x3 = inttof32(1);
@@ -818,24 +818,24 @@ GL_STATIC_INL void glRotateZi(int angle) {
\param zNear near clipping plane
\param zFar far clipping plane */
GL_STATIC_INL void glOrthof32(int32 left, int32 right, int32 bottom, int32 top, int32 zNear, int32 zFar) {
- MATRIX_MULT4x4 = divf32(inttof32(2), right - left);
- MATRIX_MULT4x4 = 0;
- MATRIX_MULT4x4 = 0;
+ MATRIX_MULT4x4 = divf32(inttof32(2), right - left);
+ MATRIX_MULT4x4 = 0;
+ MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = 0;
- MATRIX_MULT4x4 = 0;
- MATRIX_MULT4x4 = divf32(inttof32(2), top - bottom);
- MATRIX_MULT4x4 = 0;
+ MATRIX_MULT4x4 = 0;
+ MATRIX_MULT4x4 = divf32(inttof32(2), top - bottom);
+ MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = 0;
- MATRIX_MULT4x4 = 0;
- MATRIX_MULT4x4 = 0;
- MATRIX_MULT4x4 = divf32(inttof32(-2), zFar - zNear);
+ MATRIX_MULT4x4 = 0;
+ MATRIX_MULT4x4 = 0;
+ MATRIX_MULT4x4 = divf32(inttof32(-2), zFar - zNear);
MATRIX_MULT4x4 = 0;
- MATRIX_MULT4x4 = -divf32(right + left, right - left);//0;
- MATRIX_MULT4x4 = -divf32(top + bottom, top - bottom); //0;
- MATRIX_MULT4x4 = -divf32(zFar + zNear, zFar - zNear);//0;
+ MATRIX_MULT4x4 = -divf32(right + left, right - left);//0;
+ MATRIX_MULT4x4 = -divf32(top + bottom, top - bottom); //0;
+ MATRIX_MULT4x4 = -divf32(zFar + zNear, zFar - zNear);//0;
MATRIX_MULT4x4 = floattof32(1.0F);
}
@@ -851,47 +851,47 @@ GL_STATIC_INL void glOrthof32(int32 left, int32 right, int32 bottom, int32 top,
\param upz <upx, upy, upz> Unit vector describing which direction is up for the camera. */
GL_STATIC_INL void gluLookAtf32(int32 eyex, int32 eyey, int32 eyez, int32 lookAtx, int32 lookAty, int32 lookAtz, int32 upx, int32 upy, int32 upz) {
int32 side[3], forward[3], up[3], eye[3];
-
- forward[0] = eyex - lookAtx;
- forward[1] = eyey - lookAty;
- forward[2] = eyez - lookAtz;
-
- normalizef32(forward);
-
- up[0] = upx;
- up[1] = upy;
- up[2] = upz;
- eye[0] = eyex;
- eye[1] = eyey;
- eye[2] = eyez;
-
- crossf32(up, forward, side);
-
- normalizef32(side);
-
+
+ forward[0] = eyex - lookAtx;
+ forward[1] = eyey - lookAty;
+ forward[2] = eyez - lookAtz;
+
+ normalizef32(forward);
+
+ up[0] = upx;
+ up[1] = upy;
+ up[2] = upz;
+ eye[0] = eyex;
+ eye[1] = eyey;
+ eye[2] = eyez;
+
+ crossf32(up, forward, side);
+
+ normalizef32(side);
+
// Recompute local up
crossf32(forward, side, up);
-
- glMatrixMode(GL_MODELVIEW);
-
-
- // should we use MATRIX_MULT4x3?
- MATRIX_MULT4x3 = side[0];
- MATRIX_MULT4x3 = up[0];
- MATRIX_MULT4x3 = forward[0];
-
- MATRIX_MULT4x3 = side[1];
- MATRIX_MULT4x3 = up[1];
- MATRIX_MULT4x3 = forward[1];
-
- MATRIX_MULT4x3 = side[2];
- MATRIX_MULT4x3 = up[2];
- MATRIX_MULT4x3 = forward[2];
-
- MATRIX_MULT4x3 = -dotf32(eye,side);
- MATRIX_MULT4x3 = -dotf32(eye,up);
- MATRIX_MULT4x3 = -dotf32(eye,forward);
-
+
+ glMatrixMode(GL_MODELVIEW);
+
+
+ // should we use MATRIX_MULT4x3?
+ MATRIX_MULT4x3 = side[0];
+ MATRIX_MULT4x3 = up[0];
+ MATRIX_MULT4x3 = forward[0];
+
+ MATRIX_MULT4x3 = side[1];
+ MATRIX_MULT4x3 = up[1];
+ MATRIX_MULT4x3 = forward[1];
+
+ MATRIX_MULT4x3 = side[2];
+ MATRIX_MULT4x3 = up[2];
+ MATRIX_MULT4x3 = forward[2];
+
+ MATRIX_MULT4x3 = -dotf32(eye,side);
+ MATRIX_MULT4x3 = -dotf32(eye,up);
+ MATRIX_MULT4x3 = -dotf32(eye,forward);
+
}
@@ -907,18 +907,18 @@ GL_STATIC_INL void glFrustumf32(int32 left, int32 right, int32 bottom, int32 top
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = divf32(right + left, right - left);
MATRIX_MULT4x4 = 0;
-
+
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = divf32(2*near, top - bottom);
MATRIX_MULT4x4 = divf32(top + bottom, top - bottom);
MATRIX_MULT4x4 = 0;
-
+
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = -divf32(far + near, far - near);
MATRIX_MULT4x4 = floattof32(-1.0F);
MATRIX_MULT4x4 = 0;
-
+
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = -divf32(2 * mulf32(far, near), far - near);
MATRIX_MULT4x4 = 0;
@@ -929,17 +929,17 @@ GL_STATIC_INL void glFrustumf32(int32 left, int32 right, int32 bottom, int32 top
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = 0;
-
+
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = divf32(2*near, top - bottom);
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = 0;
-
+
MATRIX_MULT4x4 = divf32(right + left, right - left);
MATRIX_MULT4x4 = divf32(top + bottom, top - bottom);
MATRIX_MULT4x4 = -divf32(far + near, far - near);
MATRIX_MULT4x4 = floattof32(-1.0F);
-
+
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = 0;
MATRIX_MULT4x4 = -divf32(2 * mulf32(far, near), far - near);
@@ -948,18 +948,18 @@ GL_STATIC_INL void glFrustumf32(int32 left, int32 right, int32 bottom, int32 top
}
/*! \brief Utility function which sets up the projection matrix (fixed point version)
-\param fovy Specifies the field of view in degrees (0 -511)
+\param fovy Specifies the field of view in degrees (0 -511)
\param aspect Specifies the aspect ratio of the screen (normally screen width/screen height)
\param zNear Specifies the near clipping plane
\param zFar Specifies the far clipping plane */
GL_STATIC_INL void gluPerspectivef32(int fovy, int32 aspect, int32 zNear, int32 zFar) {
int32 xmin, xmax, ymin, ymax;
-
+
ymax = mulf32(zNear, TAN[(fovy>>1) & LUT_MASK]);
ymin = -ymax;
xmin = mulf32(ymin, aspect);
xmax = mulf32(ymax, aspect);
-
+
glFrustumf32(xmin, xmax, ymin, ymax, zNear, zFar);
}
@@ -994,17 +994,17 @@ GL_STATIC_INL void glResetMatrixStack(void) {
while(GFX_STATUS & BIT(14)){
GFX_STATUS |= 1 << 15; // clear push/pop errors or push/pop busy bit never clears
}
-
+
// pop the projection stack to the top; poping 0 off an empty stack causes an error... weird?
if((GFX_STATUS&(1<<13))!=0) {
glMatrixMode(GL_PROJECTION);
glPopMatrix(1);
}
-
+
// 31 deep modelview matrix; 32nd entry works but sets error flag
glMatrixMode(GL_MODELVIEW);
glPopMatrix((GFX_STATUS >> 8) & 0x1F);
-
+
// load identity to all the matrices
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
@@ -1014,12 +1014,12 @@ GL_STATIC_INL void glResetMatrixStack(void) {
glLoadIdentity();
}
-/*! \brief Specifies an edge color for polygons
+/*! \brief Specifies an edge color for polygons
\param id which outline color to set (0-7)
\param color the 15bit color to set */
GL_STATIC_INL void glSetOutlineColor(int id, rgb color) { GFX_EDGE_TABLE[id] = color; }
-/*! \brief Loads a toon table
+/*! \brief Loads a toon table
\param pointer to the 32 color palette to load into the toon table*/
GL_STATIC_INL void glSetToonTable(const uint16 *table) {
int i;
@@ -1069,7 +1069,7 @@ GL_STATIC_INL void glGetFixed(const GL_GET_ENUM param, int32* f) {
for(i = 0; i < 16; i++) f[i] = MATRIX_READ_CLIP[i]; // read out the position matrix
glPopMatrix(1); // restore the projection matrix
break;
- default:
+ default:
break;
}
}
@@ -1272,12 +1272,12 @@ GL_STATIC_INL void glFrustum(float left, float right, float bottom, float top, f
/*! \brief Utility function which sets up the projection matrix (floating point version)
\warning FLOAT VERSION!!!! please use gluPerspectivef32()
-\param fovy Specifies the field of view in degrees
+\param fovy Specifies the field of view in degrees
\param aspect Specifies the aspect ratio of the screen (normally screen width/screen height)
\param zNear Specifies the near clipping plane
\param zFar Specifies the far clipping plane */
GL_STATIC_INL void gluPerspective(float fovy, float aspect, float zNear, float zFar) {
- gluPerspectivef32((int)(fovy * LUT_SIZE / 360.0), floattof32(aspect), floattof32(zNear), floattof32(zFar));
+ gluPerspectivef32((int)(fovy * LUT_SIZE / 360.0), floattof32(aspect), floattof32(zNear), floattof32(zFar));
}
/*! \brief Sets texture coordinates for following vertices<BR>
@@ -1286,9 +1286,9 @@ GL_STATIC_INL void gluPerspective(float fovy, float aspect, float zNear, float z
\param s S(a.k.a. U) texture coordinate (0.0 - 1.0)
\param t T(a.k.a. V) texture coordinate (0.0 - 1.0)*/
GL_STATIC_INL void glTexCoord2f(float s, float t) {
- int x = ((glGlob->textures[glGlob->activeTexture]) >> 20) & 7;
- int y = ((glGlob->textures[glGlob->activeTexture]) >> 23) & 7;
-
+ int x = ((glGlob->textures[glGlob->activeTexture]) >> 20) & 7;
+ int y = ((glGlob->textures[glGlob->activeTexture]) >> 23) & 7;
+
glTexCoord2t16(floattot16(s*(8 << x)), floattot16(t*(8<<y)));
}
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/card.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/card.h
index 3c4a732629..0e4a19780e 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/card.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/card.h
@@ -95,10 +95,10 @@ void cardWriteEeprom(uint32 address, uint8 *data, uint32 length, uint32 addrtype
// Returns the ID of the EEPROM chip? Doesn't work well, most chips give ff,ff
// i = 0 or 1
-uint8 cardEepromReadID(uint8 i);
+uint8 cardEepromReadID(uint8 i);
// Sends a command to the EEPROM
-uint8 cardEepromCommand(uint8 command, uint32 address);
+uint8 cardEepromCommand(uint8 command, uint32 address);
/*
* -1:no card or no EEPROM
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/interrupts.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/interrupts.h
index 57d21fbc88..b5462926f5 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/interrupts.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/interrupts.h
@@ -132,7 +132,7 @@ struct IntTable{IntFn handler; u32 mask;};
Call this function at the start of any application which requires interrupt support.
This function should be used in preference to irqInitHandler.
-
+
*/
void irqInit(void);
/*! \fn irqSet(IRQ_MASK irq, VoidFunctionPointer handler)
@@ -160,7 +160,7 @@ void irqClear(IRQ_MASK irq);
This function installs the main interrupt function, all interrupts are serviced through this routine. For most
purposes the libnds interrupt dispacther should be used in preference to user code unless you know *exactly* what you're doing.
-
+
\param handler Address of the function to use as an interrupt dispatcher
\note the function *must* be ARM code
*/
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/registers_alt.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/registers_alt.h
index 32cc36b04d..1178f3f32f 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/registers_alt.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/registers_alt.h
@@ -28,7 +28,7 @@
/*
This file should be deprecated.
-
+
All hardware register defines should be replaced with REG_ for consistency and namespacing
http://forum.gbadev.org/viewtopic.php?t=4993
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/reload.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/reload.h
index de19c2c08b..c95ae3aaa4 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/reload.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/reload.h
@@ -34,11 +34,11 @@
#ifndef _NDS_LOAD_H_
#define _NDS_LOAD_H_
-
-
+
+
typedef void __attribute__ ((long_call)) (*COPYFUNC)(const char*);
typedef u32 __attribute__ ((long_call)) (*QUERYFUNC)(u32);
-
+
typedef struct {
u32 VERSION; // contains version information about loader
QUERYFUNC QUERY; // used to retreive extended information from loader
@@ -47,33 +47,33 @@ typedef struct {
const char *PATH; // THIS VALUE IS SET FOR YOU, DONT TOUCH IT
u32 RESERVED; // reserved for future expansion
} LOADER_DATA;
-
+
#define LOADNDS ((volatile LOADER_DATA*)(0x02800000-48))
#define BOOT_NDS ((const char*)-1)
-
-
-
+
+
+
/*
dump this near the begining of your ARM7's main function
-
+
LOADNDS->PATH = 0;
-
-
+
+
inside of your ARM7's main loop or VBlank IRQ or what-ever, add this code:
-
+
if (LOADNDS->PATH != 0) {
LOADNDS->ARM7FUNC(LOADNDS->PATH);
}
-
-
+
+
//////////////////////////////////////
-
+
in your ARM9 code, to return to the menu, call this function:
-
+
WAIT_CR &= ~0x8080;
LOADNDS->ARM9FUNC(BOOT_NDS);
-
+
*/
-
-
+
+
#endif //_NDS_LOAD_H_
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/system.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/system.h
index 0684c6faf9..3d22cd21e4 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/system.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/system.h
@@ -211,7 +211,7 @@ typedef struct tPERSONAL_DATA {
unsigned settingsLost : 1; //!< User Settings Lost (0=Normal, 1=Prompt/Settings Lost)
unsigned RESERVED2 : 6; //!< ???
} _user_data;
-
+
u16 RESERVED3;
u32 rtcOffset;
u32 RESERVED4;
@@ -236,7 +236,7 @@ typedef struct tPERSONAL_DATA {
*/
struct __argv {
- int argvMagic; //!< argv magic number, set to 0x5f617267 ('_arg') if valid
+ int argvMagic; //!< argv magic number, set to 0x5f617267 ('_arg') if valid
char *commandLine; //!< base address of command line, set of null terminated strings
int length; //!< total length of command line
};
diff --git a/c/src/lib/libbsp/arm/nds/libnds/include/nds/timers.h b/c/src/lib/libbsp/arm/nds/libnds/include/nds/timers.h
index 39951d33ca..2ac29fc4c7 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/include/nds/timers.h
+++ b/c/src/lib/libbsp/arm/nds/libnds/include/nds/timers.h
@@ -32,7 +32,7 @@
The timers are fed with a 33.4 MHz source on the ARM9. The ARM7
timing hasn't been tested yet, but is likely to be the same.
*/
-
+
//---------------------------------------------------------------------------------
#ifndef NDS_TIMERS_INCLUDE
#define NDS_TIMERS_INCLUDE
@@ -61,15 +61,15 @@ extern "C" {
Clock divider is controlled by %TIMER_CR(n) \n
\n
<b>Example Usage:</b>
-
- %TIMER_DATA(0) = %TIMER_FREQ(freq_in_hz); \n
+
+ %TIMER_DATA(0) = %TIMER_FREQ(freq_in_hz); \n
%TIMER_CR(0) = %TIMER_DIV1 | %TIMER_ENABLE; \n
\n
Max frequency is: 33554432Hz\n
Min frequency is: 512Hz\n
*/
#define TIMER_FREQ(n) (-0x2000000/(n))
-
+
//! A macro that calculates %TIMER_DATA(n) settings for a given frequency of n.
/*! Use the appropriate macro depending on clock divider: \n
<ul>
@@ -83,13 +83,13 @@ extern "C" {
Clock divider is controlled by %TIMER_CR(n) \n
\n
<b>Example Usage:</b>
- %TIMER_DATA(x) = %TIMER_FREQ_64(freq_in_hz)\n
+ %TIMER_DATA(x) = %TIMER_FREQ_64(freq_in_hz)\n
\n
Max frequency is: 524288Hz\n
Min frequency is: 8Hz\n
*/
#define TIMER_FREQ_64(n) (-(0x2000000>>6)/(n))
-
+
//! A macro that calculates %TIMER_DATA(n) settings for a given frequency of n.
/*! Use the appropriate macro depending on clock divider: \n
<ul>
@@ -102,13 +102,13 @@ extern "C" {
Clock divider is controlled by %TIMER_CR(n) \n
\n
<b>Example Usage:</b>
- %TIMER_DATA(x) = %TIMER_FREQ_256(freq_in_hz)\n
+ %TIMER_DATA(x) = %TIMER_FREQ_256(freq_in_hz)\n
\n
Max frequency is: 131072Hz\n
Min frequency is: 2Hz\n
*/
#define TIMER_FREQ_256(n) (-(0x2000000>>8)/(n))
-
+
//! A macro that calculates %TIMER_DATA(n) settings for a given frequency of n.
/*! Use the appropriate macro depending on clock divider: \n
<ul>
@@ -121,7 +121,7 @@ extern "C" {
Clock divider is controlled by %TIMER_CR(n) \n
\n
<b>Example Usage:</b>
- %TIMER_DATA(x) = %TIMER_FREQ_1024(freq_in_hz)\n
+ %TIMER_DATA(x) = %TIMER_FREQ_1024(freq_in_hz)\n
\n
Max frequency is: 32768Hz\n
Min frequency is: 0.5Hz\n
@@ -166,13 +166,13 @@ extern "C" {
/*! <b>Example Usage:</b> %TIMER_CR(x) = %TIMER_ENABLE | %TIMER_DIV_64; \n
\n
Possible bit defines: \n
-
- \see TIMER_ENABLE
- \see TIMER_IRQ_REQ
- \see TIMER_DIV_1
- \see TIMER_DIV_64
- \see TIMER_DIV_256
- \see TIMER_DIV_1024
+
+ \see TIMER_ENABLE
+ \see TIMER_IRQ_REQ
+ \see TIMER_DIV_1
+ \see TIMER_DIV_64
+ \see TIMER_DIV_256
+ \see TIMER_DIV_1024
*/
#define TIMER_CR(n) (*(vuint16*)(0x04000102+((n)<<2)))
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/clock.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/clock.c
index 78727af35c..b8e7adbccd 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/clock.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/clock.c
@@ -171,7 +171,7 @@ void rtcGetTimeAndDate(uint8 * time) {
void rtcSetTimeAndDate(uint8 * time) {
//---------------------------------------------------------------------------------
uint8 command[8];
-
+
int i;
for ( i=0; i< 8; i++ ) {
command[i+1] = time[i];
@@ -204,7 +204,7 @@ void rtcGetTime(uint8 * time) {
void rtcSetTime(uint8 * time) {
//---------------------------------------------------------------------------------
uint8 command[4];
-
+
int i;
for ( i=0; i< 3; i++ ) {
command[i+1] = time[i];
@@ -226,7 +226,7 @@ void syncRTC() {
}
}
}
-
+
IPC->unixTime++;
}
@@ -246,11 +246,11 @@ void initClockIRQ() {
command[0] = WRITE_STATUS_REG2;
command[1] = 0x41;
rtcTransaction(command, 2, 0, 0);
-
+
command[0] = WRITE_INT_REG1;
command[1] = 0x01;
rtcTransaction(command, 2, 0, 0);
-
+
command[0] = WRITE_INT_REG2;
command[1] = 0x00;
command[2] = 0x21;
@@ -270,9 +270,9 @@ void initClockIRQ() {
currentTime.tm_mday = IPC->time.rtc.day;
currentTime.tm_mon = IPC->time.rtc.month - 1;
currentTime.tm_year = IPC->time.rtc.year + 100;
-
+
currentTime.tm_isdst = -1;
-
+
IPC->unixTime = mktime(&currentTime);
}
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/touch.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/touch.c
index 11c25cb03c..a62b6bf8b4 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/touch.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/touch.c
@@ -94,7 +94,7 @@ uint16 touchRead(uint32 command) {
uint32 oldIME = REG_IME;
REG_IME = 0;
-
+
SerialWaitBusy();
// Write the command and wait for it to complete
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/userSettings.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/userSettings.c
index 8e92cb2b79..4aa7a8f7e8 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/userSettings.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/userSettings.c
@@ -39,10 +39,10 @@ void readUserSettings() {
uint32 userSettingsBase;
readFirmware( 0x20, &userSettingsBase,2);
-
+
uint32 slot1Address = userSettingsBase * 8;
uint32 slot2Address = userSettingsBase * 8 + 0x100;
-
+
readFirmware( slot1Address , &slot1, sizeof(PERSONAL_DATA));
readFirmware( slot2Address , &slot2, sizeof(PERSONAL_DATA));
readFirmware( slot1Address + 0x70, &slot1count, 2);
@@ -52,20 +52,20 @@ void readUserSettings() {
// default to slot 1 user Settings
void *currentSettings = &slot1;
-
+
short calc1CRC = swiCRC16( 0xffff, &slot1, sizeof(PERSONAL_DATA));
short calc2CRC = swiCRC16( 0xffff, &slot2, sizeof(PERSONAL_DATA));
// bail out if neither slot is valid
if ( calc1CRC != slot1CRC && calc2CRC != slot2CRC) return;
-
+
// if both slots are valid pick the most recent
- if ( calc1CRC == slot1CRC && calc2CRC == slot2CRC ) {
+ if ( calc1CRC == slot1CRC && calc2CRC == slot2CRC ) {
currentSettings = (slot2count == (( slot2count + 1 ) & 0x7f) ? &slot2 : &slot1);
} else {
if ( calc2CRC == slot2CRC )
currentSettings = &slot2;
}
memcpy ( PersonalData, currentSettings, sizeof(PERSONAL_DATA));
-
+
}
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/boxtest.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/boxtest.c
index 47b44369c3..d88ffeddb5 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/boxtest.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/boxtest.c
@@ -83,6 +83,6 @@ int BoxTest(v16 x, v16 y, v16 z, v16 width, v16 height, v16 depth)
int BoxTestf(float x, float y, float z, float width, float height, float depth)
//---------------------------------------------------------------------------------
{
- return BoxTest(floattov16(x), floattov16(y), floattov16(z),
+ return BoxTest(floattov16(x), floattov16(y), floattov16(z),
floattov16(width), floattov16(height), floattov16(depth));
}
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/console.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/console.c
index f9ae38de45..6f03a9383b 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/console.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/console.c
@@ -83,7 +83,7 @@ static void consoleCls(char mode) {
col = colTemp;
row = rowTemp;
break;
- }
+ }
case '1':
{
colTemp = col;
@@ -97,7 +97,7 @@ static void consoleCls(char mode) {
col = colTemp;
row = rowTemp;
break;
- }
+ }
case '2':
{
row = 0;
@@ -108,7 +108,7 @@ static void consoleCls(char mode) {
row = 0;
col = 0;
break;
- }
+ }
}
}
//---------------------------------------------------------------------------------
@@ -131,7 +131,7 @@ static void consoleClearLine(char mode) {
col = colTemp;
break;
- }
+ }
case '1':
{
colTemp = col;
@@ -145,7 +145,7 @@ static void consoleClearLine(char mode) {
col = colTemp;
break;
- }
+ }
case '2':
{
colTemp = col;
@@ -202,7 +202,7 @@ int con_write(struct _reent *r,int fd,const char *ptr,int len) {
chr = *(tmp++);
i++; count++; escapelen++;
int parameter;
-
+
switch (chr) {
/////////////////////////////////////////
// Cursor directional movement
@@ -374,12 +374,12 @@ void consoleInit( u16* font, u16* charBase,
}
//---------------------------------------------------------------------------------
-// Places the console in a default mode using bg0 of the sub display, and vram c for
+// Places the console in a default mode using bg0 of the sub display, and vram c for
// font and map..this is provided for rapid prototyping and nothing more
void consoleDemoInit(void) {
//---------------------------------------------------------------------------------
videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); //sub bg 0 will be used to print text
- vramSetBankC(VRAM_C_SUB_BG);
+ vramSetBankC(VRAM_C_SUB_BG);
SUB_BG0_CR = BG_MAP_BASE(31);
@@ -430,7 +430,7 @@ void consolePrintChar(char c) {
The only special characters we will handle are tab (\t), carriage return (\r) & line feed (\n).
Carriage return & line feed will function the same: go to next line and put cursor at the beginning.
For everything else, use VT sequences.
-
+
Reason: VT sequences are more specific to the task of cursor placement.
The special escape sequences \b \f & \v are archaic and non-portable.
*/
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/gurumeditation.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/gurumeditation.c
index 5f0bc15786..5420de9d12 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/gurumeditation.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/gurumeditation.c
@@ -236,7 +236,7 @@ static void defaultHandler(void) {
exceptionAddress = getExceptionAddress( codeAddress, thumbState);
else
exceptionAddress = codeAddress;
-
+
} else {
if (thumbState)
offset = 2;
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/image.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/image.c
index 410a37c1c9..c2de69ee94 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/image.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/image.c
@@ -25,16 +25,154 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.7 2007/01/19 14:46:00 wntrmute
name anonymous structs and unions for -std=c99
-
+
Revision 1.6 2005/10/11 05:05:26 dovoto
Added imageTileData(sImage* img) to allow loading of pcx as sprite data.
Updated pcx.c to set image bit per pixel field
-
+
Revision 1.5 2005/08/30 17:54:45 wntrmute
only include required headers
-
+
Revision 1.4 2005/08/22 08:10:35 wntrmute
reformatted for consistency
@@ -123,13 +261,13 @@ void image8to16trans(sImage* img, u8 transparentColor) {
void imageTileData(sImage* img) {
//---------------------------------------------------------------------------------
u32* temp;
-
+
int ix, iy, tx, ty;
int th, tw;
int i = 0;
-
+
//can only tile 8 bit data that is a multiple of 8 in dimention
if(img->bpp != 8 || (img->height & 3) != 0 || (img->width & 3) != 0) return;
@@ -137,16 +275,16 @@ void imageTileData(sImage* img) {
tw = img->width >> 3;
//buffer to hold data
- temp = (u32*)malloc(img->height * img->width);
+ temp = (u32*)malloc(img->height * img->width);
for(ty = 0; ty < th; ty++)
for(tx = 0; tx < tw; tx++)
for(iy = 0; iy < 8; iy++)
for(ix = 0; ix < 2; ix++)
- temp[i++] = img->image.data32[ix + tx * 2 + (iy + ty * 8) * tw * 2 ];
+ temp[i++] = img->image.data32[ix + tx * 2 + (iy + ty * 8) * tw * 2 ];
free(img->image.data32);
-
+
img->image.data32 = temp;
}
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/keys.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/keys.c
index 395b1cf237..7f8fb665b0 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/keys.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/keys.c
@@ -25,9 +25,147 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.15 2006/07/04 01:45:31 wntrmute
remove unused variables
-
+
Revision 1.14 2006/07/02 17:36:51 wntrmute
remove unnecessary IPC reads
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/ndsmotion.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/ndsmotion.c
index bd41e7cf5f..fead023ac7 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/ndsmotion.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/ndsmotion.c
@@ -2,7 +2,7 @@
$Id$
DS Motion Card/DS Motion Pak functionality
-
+
Copyright (C) 2007
Michael Noland (joat)
Jason Rogers (dovoto)
@@ -171,7 +171,7 @@ int motion_init(void) {
sysSetBusOwners(true, true);
// first, check for the DS Motion Pak - type 1
if( motion_pak_is_inserted() == 1 )
- {
+ {
card_type = 1;
return 1;
}// next, check for DS Motion Card - type 2
@@ -180,11 +180,11 @@ int motion_init(void) {
card_type = 2;
return 2;
}
-
+
motion_MK6_sensor_mode(); // send command to switch MK6 to sensor mode
-
+
if( motion_enable(3) == 1 )
- {
+ {
card_type = 3;
return 3;
}// if neither cases are true, then return 0 to indicate no DS Motion Sensor
@@ -237,7 +237,7 @@ signed int motion_read_x(void) {
output = ( (motion_spi(0x00)<<8)|motion_spi(0x00) )>>4; // read 16 bits and store as a 12 bit number
SPI_Off()
return output;
- break;
+ break;
default:
return 0;
break;
@@ -276,7 +276,7 @@ signed int motion_read_y(void) {
output = ( (motion_spi(0x00)<<8)|motion_spi(0x00) )>>4; // read 16 bits and store as a 12 bit number
SPI_Off()
return output;
- break;
+ break;
default:
return 0;
break;
@@ -315,7 +315,7 @@ signed int motion_read_z(void) {
output = ( (motion_spi(0x00)<<8)|motion_spi(0x00) )>>4; // read 16 bits and store as a 12 bit number
SPI_Off()
return output;
- break;
+ break;
default:
return 0;
break;
@@ -354,7 +354,7 @@ signed int motion_read_gyro(void) {
output = ( (motion_spi(0x00)<<8)|motion_spi(0x00) )>>4; // read 16 bits and store as a 12 bit number
SPI_Off()
return output;
- break;
+ break;
default:
return 0;
break;
@@ -483,6 +483,6 @@ int motion_read_ain_2(void){
swiDelay(WAIT_CYCLES); // wait after for Motion Pak to be ready for next command
signed int output = (signed int)( (High_byte<<8 | Low_byte)>>4);
return output;
-}
+}
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/pcx.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/pcx.c
index 6e56011051..0b570476d5 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/pcx.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/pcx.c
@@ -23,31 +23,169 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.9 2007/01/19 14:46:00 wntrmute
name anonymous structs and unions for -std=c99
-
+
Revision 1.8 2005/11/07 04:12:34 dovoto
Fixed palette rounding issue
-
+
Revision 1.7 2005/10/11 05:05:26 dovoto
Added imageTileData(sImage* img) to allow loading of pcx as sprite data.
Updated pcx.c to set image bit per pixel field
-
+
Revision 1.6 2005/08/23 17:06:10 wntrmute
converted all endings to unix
-
+
Revision 1.5 2005/08/03 18:08:13 wntrmute
*** empty log message ***
-
+
Revision 1.4 2005/08/03 05:18:06 wntrmute
tidied formatting
-
+
Revision 1.3 2005/08/03 05:05:59 dovoto
added rounding to palette conversion
-
+
Revision 1.2 2005/08/01 23:18:22 wntrmute
adjusted headers for logging
-
+
Revision 1.1 2005/07/27 02:20:52 wntrmute
add image functions
@@ -62,11 +200,11 @@ int loadPCX(unsigned char* pcx, sImage* image) {
//---------------------------------------------------------------------------------
//struct rgb {unsigned char b,g,r;};
RGB_24* pal;
-
+
PCXHeader* hdr = (PCXHeader*) pcx;
pcx += sizeof(PCXHeader);
-
+
unsigned char c;
int size;
int count;
@@ -77,30 +215,30 @@ int loadPCX(unsigned char* pcx, sImage* image) {
image->height = hdr->ymax - hdr->ymin + 1;
size = image->width *image->height;
-
+
image->image.data8 = (unsigned char*)malloc(size);
image->palette = (unsigned short*)malloc(256 * 2);
if(hdr->bitsPerPixel != 8)
return 0;
-
+
count = 0;
while(count < size) {
c = *pcx++;
-
+
if(c < 192) {
image->image.data8[count++] = c;
} else {
run = c - 192;
-
+
c = *pcx++;
-
+
for(i = 0; i < run; i++)
image->image.data8[count++] = c;
}
}
-
+
pal = (RGB_24*)(pcx + 1);
image->bpp = 8;
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/rumble.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/rumble.c
index 6b5a8959c8..e027dcc5e2 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/rumble.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/rumble.c
@@ -11,7 +11,7 @@
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
-
+
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
@@ -22,20 +22,158 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.5 2007/02/07 16:38:11 wntrmute
add warioware rumble support
-
+
Revision 1.4 2006/04/26 05:54:00 wntrmute
removed include of nds.h
reformatted for consistency
-
+
Revision 1.3 2005/11/27 07:47:07 joatski
Fixed multiple linebreaks.
Moved cart bus control functions and GBA header to memory.h
-
+
Revision 1.2 2005/11/02 07:06:20 bigredpimp
Added revision comment block
-
+
---------------------------------------------------------------------------------*/
#include <nds/jtypes.h>
#include <nds/memory.h>
@@ -64,7 +202,7 @@ bool isRumbleInserted(void) {
return true;
}
return false;
-
+
} else {
rumbleType = RUMBLE;
@@ -81,7 +219,7 @@ void setRumble(bool position) {
//---------------------------------------------------------------------------------
if( rumbleType == WARIOWARE) {
- WARIOWARE_PAK = (position ? 8 : 0);
+ WARIOWARE_PAK = (position ? 8 : 0);
} else {
RUMBLE_PAK = (position ? 2 : 0);
}
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/sound.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/sound.c
index e2c0570c44..134535ec2e 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/sound.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/sound.c
@@ -24,9 +24,147 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.3 2005/09/12 06:53:27 wntrmute
fixed PlaySound
-
+
Revision 1.2 2005/08/04 17:57:58 wntrmute
playSoundBlock internal only
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/touch.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/touch.c
index cc527eab13..68b34e6bdd 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/touch.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/touch.c
@@ -24,15 +24,153 @@
distribution.
$Log$
+ Revision 1.1 2008/04/16 18:37:32 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.5 2007/05/01 22:53:09 wntrmute
remove stupid mailBusy check
-
+
Revision 1.4 2005/10/09 20:27:23 wntrmute
add check for arm7 updating IPC
-
+
Revision 1.3 2005/08/30 17:53:11 wntrmute
only include required headers
-
+
Revision 1.2 2005/08/23 17:06:10 wntrmute
converted all endings to unix
@@ -51,7 +189,7 @@
//---------------------------------------------------------------------------------
touchPosition touchReadXY() {
//---------------------------------------------------------------------------------
-
+
touchPosition touchPos;
touchPos.x = IPC->touchX;
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/videoGL.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/videoGL.c
index 217beb0582..c2161b4ec9 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/arm9/videoGL.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm9/videoGL.c
@@ -166,7 +166,7 @@ void glResetTextures(void) {
//---------------------------------------------------------------------------------
// glGenTextures creates integer names for your table
-// takes n as the number of textures to generate and
+// takes n as the number of textures to generate and
// a pointer to the names array that it needs to fill.
// Returns 1 if succesful and 0 if out of texture names
//---------------------------------------------------------------------------------
@@ -185,43 +185,43 @@ int glGenTextures(int n, int *names) {
//---------------------------------------------------------------------------------
// glBindTexure sets the current named
-// texture to the active texture. Target
+// texture to the active texture. Target
// is ignored as all DS textures are 2D
//---------------------------------------------------------------------------------
void glBindTexture(int target, int name) {
//---------------------------------------------------------------------------------
- if (name == 0)
- GFX_TEX_FORMAT = 0;
- else
- GFX_TEX_FORMAT = glGlob->textures[name];
+ if (name == 0)
+ GFX_TEX_FORMAT = 0;
+ else
+ GFX_TEX_FORMAT = glGlob->textures[name];
glGlob->activeTexture = name;
}
//---------------------------------------------------------------------------------
// glColorTable establishes the location of the current palette.
-// Roughly follows glColorTableEXT. Association of palettes with
-// named textures is left to the application.
+// Roughly follows glColorTableEXT. Association of palettes with
+// named textures is left to the application.
//---------------------------------------------------------------------------------
void glColorTable( uint8 format, uint32 addr ) {
//---------------------------------------------------------------------------------
GFX_PAL_FORMAT = addr>>(4-(format==GL_RGB4));
}
-
+
//---------------------------------------------------------------------------------
//---------------------------------------------------------------------------------
-void glTexCoord2f32(int32 u, int32 v) {
+void glTexCoord2f32(int32 u, int32 v) {
//---------------------------------------------------------------------------------
- int x, y;
+ int x, y;
- x = ((glGlob->textures[glGlob->activeTexture]) >> 20) & 7;
- y = ((glGlob->textures[glGlob->activeTexture]) >> 23) & 7;
+ x = ((glGlob->textures[glGlob->activeTexture]) >> 20) & 7;
+ y = ((glGlob->textures[glGlob->activeTexture]) >> 23) & 7;
- glTexCoord2t16(f32tot16 (mulf32(u,inttof32(8<<x))), f32tot16 (mulf32(v,inttof32(8<<y))));
+ glTexCoord2t16(f32tot16 (mulf32(u,inttof32(8<<x))), f32tot16 (mulf32(v,inttof32(8<<y))));
}
//---------------------------------------------------------------------------------
-// glTexParameter although named the same
+// glTexParameter although named the same
// as its gl counterpart it is not compatible
// Effort may be made in the future to make it so.
//---------------------------------------------------------------------------------
@@ -260,7 +260,7 @@ int getNextPaletteSlot(u16 count, uint8 format) {
uint32 result = alignVal(glGlob->nextPBlock, 1<<(4-(format==GL_RGB4)));
// convert count to bytes and align to next (smallest format) palette block
- count = alignVal( count<<1, 1<<3 );
+ count = alignVal( count<<1, 1<<3 );
// ensure that end is within palette video mem
if( result+count > 0x10000 ) // VRAM_F - VRAM_E
@@ -268,7 +268,7 @@ int getNextPaletteSlot(u16 count, uint8 format) {
glGlob->nextPBlock = result+count;
return (int)result;
-}
+}
//---------------------------------------------------------------------------------
uint16* vramGetBank(uint16 *addr) {
@@ -324,7 +324,7 @@ int vramIsTextureBank(uint16 *addr) {
}
else
return 0;
-}
+}
//---------------------------------------------------------------------------------
uint32* getNextTextureSlot(int size) {
//---------------------------------------------------------------------------------
@@ -335,7 +335,7 @@ uint32* getNextTextureSlot(int size) {
while(!vramIsTextureBank((uint16*)glGlob->nextBlock - 1) && glGlob->nextBlock <= (uint32*)VRAM_E)
{
glGlob->nextBlock = (uint32*)vramGetBank((uint16*)result) + (0x20000 >> 2); //next bank
- result = glGlob->nextBlock;
+ result = glGlob->nextBlock;
glGlob->nextBlock += size >> 2;
}
@@ -343,7 +343,7 @@ uint32* getNextTextureSlot(int size) {
result = 0;
}
return result;
-}
+}
//---------------------------------------------------------------------------------
// Similer to glTextImage2D from gl it takes a pointer to data
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/common/biosCalls.S b/c/src/lib/libbsp/arm/nds/libnds/source/common/biosCalls.S
index 5f23c83713..8d85bd784c 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/common/biosCalls.S
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/common/biosCalls.S
@@ -24,9 +24,27 @@
distribution.
$Log$
+ Revision 1.1 2008/04/17 23:09:41 joel
+ 2008-04-17 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * Makefile.am: Move .s files to .S
+ * dswifi/common/source/spinlock.S, libfat/source/disc_io/io_dldi.S,
+ libfat/source/disc_io/io_scsd_s.S, libnds/source/arm9/COS.S,
+ libnds/source/arm9/SIN.S, libnds/source/arm9/TAN.S,
+ libnds/source/arm9/dcache.S, libnds/source/arm9/default_font.S,
+ libnds/source/arm9/icache.S, libnds/source/common/biosCalls.S,
+ libnds/source/common/interruptDispatcher.S: New files.
+ * dswifi/common/source/spinlock.s, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_scsd_s.s, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.s, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.s, libnds/source/arm9/icache.s,
+ libnds/source/common/biosCalls.s,
+ libnds/source/common/interruptDispatcher.s: Removed.
+
Revision 1.1 2008/04/16 18:37:32 joel
2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
-
+
* ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
@@ -161,22 +179,22 @@
touchscreen/reco.h, touchscreen/touchscreen.c,
touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
New files.
-
+
Revision 1.5 2006/03/15 12:37:14 wntrmute
reformatted for legibility
grouped arm7 and arm9 specific code
-
+
Revision 1.4 2006/03/03 07:20:14 joatski
Fixed a couple of little bugs (e.g. swiSetHaltCR using r0 instead of r2 on ARM7)
Commented out ARM7 swis in ARM9 mode, and vis versa
-
+
Revision 1.3 2006/01/17 00:13:36 dovoto
Fixed swi 08 so lable and global matched "swiChangeSoundBias"
-
+
Revision 1.2 2005/09/03 13:47:13 wntrmute
added logging to header
reformatted for legibility
-
+
---------------------------------------------------------------------------------*/
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/common/card.c b/c/src/lib/libbsp/arm/nds/libnds/source/common/card.c
index a0932a3a4e..b474fed1ab 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/common/card.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/common/card.c
@@ -180,7 +180,7 @@ int cardEepromGetType(void)
c9f=cardEepromCommand(0x9f,0);
c00=cardEepromCommand(0x00,0);
- if((c00==0x00) && (c9f==0x00)) return 0; // PassMe?
+ if((c00==0x00) && (c9f==0x00)) return 0; // PassMe?
if((c00==0xff) && (c05==0xff) && (c9f==0xff))return -1;
if((c00==0xff) && (c05 & 0xFD) == 0xF0 && (c9f==0xff))return 1;
@@ -227,10 +227,10 @@ uint32 cardEepromGetSize() {
uint8 c9f;
c9f=cardEepromCommand(0x9f,0);
- if(c9f==0x14)
+ if(c9f==0x14)
return 1024*1024; // NEW TYPE 3++ 8Mbit(1024KByte)
- if(c9f==0x13)
+ if(c9f==0x13)
return 512*1024; // NEW TYPE 3+ 4Mbit(512KByte)
return 256*1024; // TYPE 3 2Mbit(256KByte)
@@ -251,8 +251,8 @@ void cardReadEeprom(uint32 address, uint8 *data, uint32 length, uint32 addrtype)
if (addrtype == 3) {
CARD_EEPDATA = (address >> 16) & 0xFF;
EepromWaitBusy();
- }
-
+ }
+
if (addrtype >= 2) {
CARD_EEPDATA = (address >> 8) & 0xFF;
EepromWaitBusy();
@@ -320,9 +320,9 @@ void cardWriteEeprom(uint32 address, uint8 *data, uint32 length, uint32 addrtype
EepromWaitBusy();
}
- for (i=0; address<address_end && i<maxblocks; i++, address++) {
- CARD_EEPDATA = *data++;
- EepromWaitBusy();
+ for (i=0; address<address_end && i<maxblocks; i++, address++) {
+ CARD_EEPDATA = *data++;
+ EepromWaitBusy();
}
CARD_CR1 = /*MODE*/0x40;
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/common/gbfs.c b/c/src/lib/libbsp/arm/nds/libnds/source/common/gbfs.c
index cc9348a4e8..0597f2dadc 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/common/gbfs.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/common/gbfs.c
@@ -28,15 +28,153 @@
IN THE SOFTWARE.
$Log$
+ Revision 1.1 2008/04/16 18:37:33 joel
+ 2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
+
+ * ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+ mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
+ clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
+ coproc/coproc.ld, dswifi/dswifi_license.txt, dswifi/makefile,
+ dswifi/arm7/makefile, dswifi/arm7/source/wifi_arm7.c,
+ dswifi/arm7/source/wifi_arm7.h, dswifi/arm9/makefile,
+ dswifi/arm9/source/sgIP.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.c, dswifi/arm9/source/sgIP_ARP.h,
+ dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.c,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.c,
+ dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.c,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.c,
+ dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.c,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.c,
+ dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.c,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.c,
+ dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/sgIP_sockets.c, dswifi/arm9/source/sgIP_sockets.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/common/source/dsregs.h, dswifi/common/source/spinlock.h,
+ dswifi/common/source/spinlock.s, dswifi/common/source/wifi_shared.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h,
+ dswifi/include/dswifi_version.h, dswifi/include/netdb.h,
+ dswifi/include/sgIP_errno.h, dswifi/include/netinet/in.h, fb/fb.c,
+ fb/fb.h, include/bsp.h, include/my_ipc.h, include/tm27.h,
+ include/types.h, include/sys/iosupport.h, irq/irq.c, irq/irq.h,
+ libfat/gba/include/fat.h, libfat/include/fat.h,
+ libfat/nds/include/fat.h, libfat/source/bit_ops.h,
+ libfat/source/cache.c, libfat/source/cache.h, libfat/source/common.h,
+ libfat/source/directory.c, libfat/source/directory.h,
+ libfat/source/fatdir.c, libfat/source/fatdir.h,
+ libfat/source/fatfile.c, libfat/source/fatfile.h,
+ libfat/source/file_allocation_table.c,
+ libfat/source/file_allocation_table.h, libfat/source/filetime.c,
+ libfat/source/filetime.h, libfat/source/libfat.c,
+ libfat/source/mem_allocate.h, libfat/source/partition.c,
+ libfat/source/partition.h, libfat/source/disc_io/disc.c,
+ libfat/source/disc_io/disc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_cf_common.c,
+ libfat/source/disc_io/io_cf_common.h,
+ libfat/source/disc_io/io_dldi.h, libfat/source/disc_io/io_dldi.s,
+ libfat/source/disc_io/io_efa2.c, libfat/source/disc_io/io_efa2.h,
+ libfat/source/disc_io/io_fcsr.c, libfat/source/disc_io/io_fcsr.h,
+ libfat/source/disc_io/io_m3_common.c,
+ libfat/source/disc_io/io_m3_common.h,
+ libfat/source/disc_io/io_m3cf.c, libfat/source/disc_io/io_m3cf.h,
+ libfat/source/disc_io/io_m3sd.c, libfat/source/disc_io/io_m3sd.h,
+ libfat/source/disc_io/io_mpcf.c, libfat/source/disc_io/io_mpcf.h,
+ libfat/source/disc_io/io_njsd.c, libfat/source/disc_io/io_njsd.h,
+ libfat/source/disc_io/io_nmmc.c, libfat/source/disc_io/io_nmmc.h,
+ libfat/source/disc_io/io_sc_common.c,
+ libfat/source/disc_io/io_sc_common.h,
+ libfat/source/disc_io/io_sccf.c, libfat/source/disc_io/io_sccf.h,
+ libfat/source/disc_io/io_scsd.c, libfat/source/disc_io/io_scsd.h,
+ libfat/source/disc_io/io_scsd_s.s,
+ libfat/source/disc_io/io_sd_common.c,
+ libfat/source/disc_io/io_sd_common.h, libnds/Makefile.arm7,
+ libnds/Makefile.arm9, libnds/libnds_license.txt,
+ libnds/basicARM7/source/defaultARM7.c,
+ libnds/include/default_font_bin.h, libnds/include/gbfs.h,
+ libnds/include/nds.h, libnds/include/nds/bios.h,
+ libnds/include/nds/card.h, libnds/include/nds/dma.h,
+ libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h,
+ libnds/include/nds/jtypes.h, libnds/include/nds/memory.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/reload.h,
+ libnds/include/nds/system.h, libnds/include/nds/timers.h,
+ libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h,
+ libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h,
+ libnds/include/nds/arm9/background.h,
+ libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h,
+ libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/image.h, libnds/include/nds/arm9/input.h,
+ libnds/include/nds/arm9/math.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/pcx.h, libnds/include/nds/arm9/postest.h,
+ libnds/include/nds/arm9/rumble.h, libnds/include/nds/arm9/sound.h,
+ libnds/include/nds/arm9/sprite.h, libnds/include/nds/arm9/trig_lut.h,
+ libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h,
+ libnds/source/arm7/audio.c, libnds/source/arm7/clock.c,
+ libnds/source/arm7/microphone.c, libnds/source/arm7/spi.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/COS.bin, libnds/source/arm9/COS.s,
+ libnds/source/arm9/SIN.bin, libnds/source/arm9/SIN.s,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/TAN.s,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/console.c,
+ libnds/source/arm9/dcache.s, libnds/source/arm9/default_font.bin,
+ libnds/source/arm9/default_font.s,
+ libnds/source/arm9/exceptionHandler.S,
+ libnds/source/arm9/exceptionHandler.s,
+ libnds/source/arm9/exceptions.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/icache.s, libnds/source/arm9/image.c,
+ libnds/source/arm9/initSystem.c, libnds/source/arm9/keys.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/pcx.c,
+ libnds/source/arm9/rumble.c, libnds/source/arm9/sound.c,
+ libnds/source/arm9/system.c, libnds/source/arm9/touch.c,
+ libnds/source/arm9/video.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/biosCalls.s, libnds/source/common/card.c,
+ libnds/source/common/gbfs.c,
+ libnds/source/common/interruptDispatcher.s,
+ libnds/source/common/interrupts.c, rtc/rtc.c, sound/sound.c,
+ sound/sound.h, start/start.S, startup/linkcmds, startup/start.c,
+ timer/timer.c, tools/Makefile.am, tools/bin2s, tools/bin2s.c,
+ tools/configure.ac, tools/runtest,
+ tools/ndstool/include/arm7_sha1_homebrew.h,
+ tools/ndstool/include/arm7_sha1_nintendo.h,
+ tools/ndstool/include/banner.h, tools/ndstool/include/bigint.h,
+ tools/ndstool/include/crc.h, tools/ndstool/include/default_icon.h,
+ tools/ndstool/include/encryption.h, tools/ndstool/include/header.h,
+ tools/ndstool/include/hook.h, tools/ndstool/include/little.h,
+ tools/ndstool/include/loadme.h, tools/ndstool/include/logo.h,
+ tools/ndstool/include/ndscreate.h,
+ tools/ndstool/include/ndsextract.h, tools/ndstool/include/ndstool.h,
+ tools/ndstool/include/ndstree.h, tools/ndstool/include/overlay.h,
+ tools/ndstool/include/passme.h, tools/ndstool/include/passme_sram.h,
+ tools/ndstool/include/passme_vhd1.h,
+ tools/ndstool/include/passme_vhd2.h, tools/ndstool/include/raster.h,
+ tools/ndstool/include/sha1.h, tools/ndstool/include/types.h,
+ tools/ndstool/source/arm7_sha1_homebrew.c,
+ tools/ndstool/source/arm7_sha1_nintendo.c,
+ tools/ndstool/source/banner.cpp, tools/ndstool/source/bigint.cpp,
+ tools/ndstool/source/compile_date.c, tools/ndstool/source/crc.cpp,
+ tools/ndstool/source/default_icon.c,
+ tools/ndstool/source/encryption.cpp, tools/ndstool/source/header.cpp,
+ tools/ndstool/source/hook.cpp, tools/ndstool/source/loadme.c,
+ tools/ndstool/source/logo.cpp, tools/ndstool/source/ndscodes.cpp,
+ tools/ndstool/source/ndscreate.cpp,
+ tools/ndstool/source/ndsextract.cpp,
+ tools/ndstool/source/ndstool.cpp, tools/ndstool/source/ndstree.cpp,
+ tools/ndstool/source/passme.cpp, tools/ndstool/source/passme_sram.c,
+ tools/ndstool/source/raster.cpp, tools/ndstool/source/sha1.cpp,
+ touchscreen/README.reco, touchscreen/parser.c, touchscreen/reco.c,
+ touchscreen/reco.h, touchscreen/touchscreen.c,
+ touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
+ New files.
+
Revision 1.5 2006/05/05 05:32:06 wntrmute
consistency formatting
-
+
Revision 1.4 2006/02/25 02:31:12 wntrmute
tabs, not spaces
-
+
Revision 1.3 2005/09/20 04:59:44 wntrmute
*** empty log message ***
-
+
Revision 1.2 2005/08/23 17:06:10 wntrmute
converted all endings to unix
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/common/interruptDispatcher.S b/c/src/lib/libbsp/arm/nds/libnds/source/common/interruptDispatcher.S
index c971bb3b20..55a3fa2e67 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/common/interruptDispatcher.S
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/common/interruptDispatcher.S
@@ -22,9 +22,35 @@
distribution.
$Log$
+ Revision 1.2 2008/08/19 15:47:14 joel
+ 2008-08-19 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * dswifi/arm7/makefile, dswifi/include/netinet/in.h,
+ libnds/basicARM7/source/defaultARM7.c, libnds/include/gbfs.h,
+ libnds/include/nds/bios.h, libnds/include/nds/card.h,
+ libnds/include/nds/dma.h, libnds/include/nds/interrupts.h,
+ libnds/include/nds/ipc.h, libnds/include/nds/jtypes.h,
+ libnds/include/nds/registers_alt.h, libnds/include/nds/system.h,
+ libnds/include/nds/timers.h, libnds/include/nds/arm7/audio.h,
+ libnds/include/nds/arm7/clock.h, libnds/include/nds/arm7/serial.h,
+ libnds/include/nds/arm7/touch.h, libnds/include/nds/arm9/boxtest.h,
+ libnds/include/nds/arm9/cache.h, libnds/include/nds/arm9/console.h,
+ libnds/include/nds/arm9/ndsmotion.h, libnds/include/nds/arm9/video.h,
+ libnds/include/nds/arm9/videoGL.h, libnds/source/arm7/audio.c,
+ libnds/source/arm7/clock.c, libnds/source/arm7/microphone.c,
+ libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
+ libnds/source/arm9/boxtest.c, libnds/source/arm9/gurumeditation.c,
+ libnds/source/arm9/ndsmotion.c, libnds/source/arm9/videoGL.c,
+ libnds/source/common/card.c,
+ libnds/source/common/interruptDispatcher.S, touchscreen/reco.c: Fix
+ various warnings by fixing prototypes. Remove unused .bin files.
+ Convert all files to UNIX CF/LF.
+ * libnds/source/arm9/COS.bin, libnds/source/arm9/SIN.bin,
+ libnds/source/arm9/TAN.bin, libnds/source/arm9/default_font.bin: Removed.
+
Revision 1.1 2008/04/17 23:09:41 joel
2008-04-17 Joel Sherrill <joel.sherrill@OARcorp.com>
-
+
* Makefile.am: Move .s files to .S
* dswifi/common/source/spinlock.S, libfat/source/disc_io/io_dldi.S,
libfat/source/disc_io/io_scsd_s.S, libnds/source/arm9/COS.S,
@@ -39,10 +65,10 @@
libnds/source/arm9/exceptionHandler.s, libnds/source/arm9/icache.s,
libnds/source/common/biosCalls.s,
libnds/source/common/interruptDispatcher.s: Removed.
-
+
Revision 1.1 2008/04/16 18:37:33 joel
2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
-
+
* ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
@@ -177,38 +203,38 @@
touchscreen/reco.h, touchscreen/touchscreen.c,
touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
New files.
-
+
Revision 1.10 2007/08/11 06:00:23 wntrmute
make nesting really work
-
+
Revision 1.9 2007/01/10 15:48:27 wntrmute
remove unused code
-
+
Revision 1.8 2006/12/16 09:10:02 wntrmute
acknowledge interrupt before calling handler
-
+
Revision 1.7 2006/04/26 05:11:31 wntrmute
rebase dtcm, take __irq_flags and __irq_vector from linker script
move arm7 irq vector & irq flags to actual locations
-
+
Revision 1.6 2006/04/23 18:19:15 wntrmute
reworked interrupt code to allow dtcm moving
-
+
Revision 1.5 2005/12/12 13:01:55 wntrmute
disable interrupts on return from user handler
-
+
Revision 1.4 2005/10/21 22:43:42 wntrmute
restore REG_IME on exit from null handler
-
+
Revision 1.3 2005/09/27 18:21:53 wntrmute
safer nested interrupt support
-
+
Revision 1.2 2005/09/04 16:37:01 wntrmute
check for NULL handler
-
+
Revision 1.1 2005/09/03 17:09:35 wntrmute
added interworking aware interrupt dispatcher
-
+
---------------------------------------------------------------------------------*/
@@ -282,7 +308,7 @@ got_handler:
msr cpsr,r2
str r0, [r3, #0x0214] @ IF Clear
-
+
push {lr}
adr lr, IntrRet
bx r1
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/common/interrupts.c b/c/src/lib/libbsp/arm/nds/libnds/source/common/interrupts.c
index 2c30b91bac..f15bae2935 100644
--- a/c/src/lib/libbsp/arm/nds/libnds/source/common/interrupts.c
+++ b/c/src/lib/libbsp/arm/nds/libnds/source/common/interrupts.c
@@ -22,9 +22,30 @@
distribution.
$Log$
+ Revision 1.2 2008/08/20 16:31:41 joel
+ 2008-08-20 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * block/block.c, console/console.c, dswifi/arm9/source/sgIP.h,
+ dswifi/arm9/source/sgIP_ARP.h, dswifi/arm9/source/sgIP_Config.h,
+ dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.h,
+ dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.h,
+ dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.h,
+ dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.h,
+ dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h,
+ dswifi/include/dswifi7.h, dswifi/include/dswifi9.h, fb/fb.c,
+ include/my_ipc.h, libfat/source/disc_io/disc_io.h,
+ libfat/source/disc_io/io_nmmc.c,
+ libnds/include/nds/arm9/exceptions.h,
+ libnds/include/nds/arm9/input.h, libnds/include/nds/arm9/ndsmotion.h,
+ libnds/include/nds/arm9/videoGL.h, libnds/source/arm9/console.c,
+ libnds/source/arm9/gurumeditation.c, libnds/source/arm9/ndsmotion.c,
+ libnds/source/common/card.c, libnds/source/common/interrupts.c,
+ sound/sound.c, startup/start.c, touchscreen/reco.h, wifi/compat.c,
+ wifi/compat.h: Fix most warnings.
+
Revision 1.1 2008/04/16 18:37:33 joel
2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
-
+
* ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
@@ -159,28 +180,28 @@
touchscreen/reco.h, touchscreen/touchscreen.c,
touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
New files.
-
+
Revision 1.10 2007/02/06 12:00:32 wntrmute
use uint32 for irqEnable
-
+
Revision 1.9 2006/06/16 07:35:14 wntrmute
more moves to REG_ values
implement SetYtrigger helper function
set bits in REG_DISPSTAT for IRQ_VCOUNT
-
+
Revision 1.8 2006/02/21 00:12:35 wntrmute
clear interrupts and enable REG_IME in irqInit
-
+
Revision 1.7 2005/12/12 13:03:29 wntrmute
set/clear LCD interrupts in irqEnable/Disable
-
+
Revision 1.6 2005/11/07 01:11:08 wntrmute
more doxygen
moved IntrMain declaration to C file
-
+
Revision 1.5 2005/09/20 05:00:24 wntrmute
use new register definitions
-
+
Revision 1.4 2005/09/04 16:28:04 wntrmute
place irqTable in ewram
diff --git a/c/src/lib/libbsp/arm/nds/tools/bin2s.c b/c/src/lib/libbsp/arm/nds/tools/bin2s.c
index 34cc76cf18..7c24fb788b 100644
--- a/c/src/lib/libbsp/arm/nds/tools/bin2s.c
+++ b/c/src/lib/libbsp/arm/nds/tools/bin2s.c
@@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------------
$Id$
-
+
bin2s: convert a binary file to a gcc asm module
for gfx/foo.bin it'll write foo_bin (an array of char)
foo_bin_end, and foo_bin_len (an unsigned int)
@@ -31,9 +31,15 @@
IN THE SOFTWARE.
$Log$
+ Revision 1.2 2008/08/19 15:47:04 joel
+ 2008-08-19 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * bin2s.c: Fix various warnings by fixing prototypes. Remove unused
+ .bin files. Convert all files to UNIX CF/LF.
+
Revision 1.1 2008/04/16 18:37:33 joel
2008-04-16 Matthieu Bucchianeri <mbucchia@gmail.com>
-
+
* ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
mk_libnds.sh, patch.libnds, preinstall.am, block/block.c,
clock/clock.c, console/console.c, coproc/coproc.S, coproc/coproc.c,
@@ -168,17 +174,17 @@
touchscreen/reco.h, touchscreen/touchscreen.c,
touchscreen/touchscreen.h, wifi/compat.c, wifi/compat.h, wifi/wifi.c:
New files.
-
+
Revision 1.3 2005/08/03 05:14:53 wntrmute
corrected typo _size, not _len
Revision 1.2 2005/08/01 03:42:53 wntrmute
strip path from input file
-
+
Revision 1.1 2005/07/21 13:03:05 wntrmute
renamed labels to conform with previous bin2o
added user configurable alignment
-
+
---------------------------------------------------------------------------------*/
@@ -247,7 +253,7 @@ int main(int argc, char **argv) {
switch (argv[arg][1])
{
case 'a':
-
+
alignment = (argc > arg) ? strtoul(argv[++arg], 0, 0) : 0;
if ( alignment == 0 ) alignment =4;
@@ -255,7 +261,7 @@ int main(int argc, char **argv) {
}
continue;
}
-
+
fin = fopen(argv[arg], "rb");
@@ -278,28 +284,28 @@ int main(int argc, char **argv) {
char *ptr = argv[arg];
char chr;
char *filename = NULL;
-
+
while ( (chr=*ptr) ) {
if ( chr == '\\' || chr == '/') {
-
+
filename = ptr;
}
ptr++;
}
-
- if ( NULL != filename ) {
+
+ if ( NULL != filename ) {
filename++;
} else {
filename = argv[arg];
}
-
+
/*---------------------------------------------------------------------------------
Generate the prolog for each included file. It has two purposes:
-
+
1. provide length info, and
- 2. align to user defined boundary, default is 32bit
+ 2. align to user defined boundary, default is 32bit
---------------------------------------------------------------------------------*/
fprintf( stdout, "/* Generated by BIN2S - please don't edit directly */\n"
@@ -319,10 +325,10 @@ int main(int argc, char **argv) {
while(filelen > 0) {
unsigned char c = fgetc(fin);
-
+
printf("%3u", (unsigned int)c);
filelen--;
-
+
/* don't put a comma after the last item */
if(filelen) {
diff --git a/c/src/lib/libbsp/arm/nds/tools/ndstool/include/ndstree.h b/c/src/lib/libbsp/arm/nds/tools/ndstool/include/ndstree.h
index a51fc3a699..5d86e8cac7 100644
--- a/c/src/lib/libbsp/arm/nds/tools/ndstool/include/ndstree.h
+++ b/c/src/lib/libbsp/arm/nds/tools/ndstool/include/ndstree.h
@@ -20,7 +20,7 @@ struct TreeNode
directory = 0;
prev = next = 0;
}
-
+
// new entry in same directory
TreeNode *New(const char *name, bool isdir)
{
diff --git a/c/src/lib/libbsp/arm/nds/tools/ndstool/include/sha1.h b/c/src/lib/libbsp/arm/nds/tools/ndstool/include/sha1.h
index 95daafb292..36d9fdadc0 100644
--- a/c/src/lib/libbsp/arm/nds/tools/ndstool/include/sha1.h
+++ b/c/src/lib/libbsp/arm/nds/tools/ndstool/include/sha1.h
@@ -5,27 +5,27 @@
LICENSE TERMS
- The free distribution and use of this software in both source and binary
+ The free distribution and use of this software in both source and binary
form is allowed (with or without changes) provided that:
- 1. distributions of this source code include the above copyright
+ 1. distributions of this source code include the above copyright
notice, this list of conditions and the following disclaimer;
2. distributions in binary form include the above copyright
notice, this list of conditions and the following disclaimer
in the documentation and/or other associated materials;
- 3. the copyright holder's name is not used to endorse products
- built using this software without specific written permission.
+ 3. the copyright holder's name is not used to endorse products
+ built using this software without specific written permission.
ALTERNATIVELY, provided that this notice is retained in full, this product
may be distributed under the terms of the GNU General Public License (GPL),
in which case the provisions of the GPL apply INSTEAD OF those given above.
-
+
DISCLAIMER
This software is provided 'as is' with no explicit or implied warranties
- in respect of its properties, including, but not limited to, correctness
+ in respect of its properties, including, but not limited to, correctness
and/or fitness for purpose.
---------------------------------------------------------------------------
Issue Date: 30/11/2002
diff --git a/c/src/lib/libbsp/arm/rtl22xx/console/uart.c b/c/src/lib/libbsp/arm/rtl22xx/console/uart.c
index bdc52eda6c..f774c476bf 100644
--- a/c/src/lib/libbsp/arm/rtl22xx/console/uart.c
+++ b/c/src/lib/libbsp/arm/rtl22xx/console/uart.c
@@ -1,10 +1,10 @@
/*
* console driver for RTL22xx UARTs
*
- * This driver uses the shared console driver in
+ * This driver uses the shared console driver in
* ...../libbsp/shared/console.c
*
- * If you want the driver to be interrupt driven, you
+ * If you want the driver to be interrupt driven, you
* need to write the ISR, and in the ISR insert the
* chars into termios's queue.
* Copyright (c) By ray <rayx.cn@gmail.com>
@@ -52,8 +52,8 @@ console_data Console_Port_Data[NUM_DEVS];
rtems_device_minor_number Console_Port_Minor = 0;
/* Pointers to functions for handling the UART. */
-console_fns uart_fns =
-{
+console_fns uart_fns =
+{
libchip_serial_default_probe,
uart_first_open,
uart_last_close,
@@ -65,7 +65,7 @@ console_fns uart_fns =
FALSE /* TRUE if interrupt driven, FALSE if not. */
};
-/*
+/*
* There's one item in array for each UART.
*
* Some of these fields are marked "NOT USED". They are not used
@@ -119,25 +119,25 @@ console_tbl Console_Port_Tbl[] = {
/* Functions called via termios callbacks (i.e. the ones in uart_fns */
/*********************************************************************/
-/*
- * This is called the first time each device is opened. If the driver
- * is interrupt driven, you should enable interrupts here. Otherwise,
+/*
+ * This is called the first time each device is opened. If the driver
+ * is interrupt driven, you should enable interrupts here. Otherwise,
* it's probably safe to do nothing.
*
* Since micromonitor already set up the UART, we do nothing.
*/
-static int uart_first_open(int major, int minor, void *arg)
+static int uart_first_open(int major, int minor, void *arg)
{
return 0;
}
-/*
- * This is called the last time each device is closed. If the driver
- * is interrupt driven, you should disable interrupts here. Otherwise,
+/*
+ * This is called the last time each device is closed. If the driver
+ * is interrupt driven, you should disable interrupts here. Otherwise,
* it's probably safe to do nothing.
*/
-static int uart_last_close(int major, int minor, void *arg)
+static int uart_last_close(int major, int minor, void *arg)
{
return 0;
}
@@ -149,7 +149,7 @@ static int uart_last_close(int major, int minor, void *arg)
* Return -1 if there's no data, otherwise return
* the character in lowest 8 bits of returned int.
*/
-static int uart_read(int minor)
+static int uart_read(int minor)
{
char c;
@@ -175,8 +175,8 @@ static int uart_read(int minor)
}
-/*
- * Write buffer to UART
+/*
+ * Write buffer to UART
*
* return 1 on success, -1 on error
*/
@@ -200,7 +200,7 @@ static int uart_write(int minor, const char *buf, int len)
printk("Unknown console minor number %d\n", minor);
return -1;
}
-
+
return 1;
}
@@ -218,7 +218,7 @@ static void uart_init(int minor)
U0IER = 0x00; // disable all interrupts
// set the baudrate
- U0LCR = 1<<7; // select divisor latches
+ U0LCR = 1<<7; // select divisor latches
U0DLL = (uint8_t)baud; // set for baud low byte
U0DLM = (uint8_t)(baud >> 8); // set for baud high byte
@@ -226,23 +226,23 @@ static void uart_init(int minor)
// user specified operating parameters
U0LCR = (mode & ~ULCR_DLAB_ENABLE);
U0FCR = mode>>8; /*fifo mode*/
-
+
// set port pins for UART1
PINSEL0 = (PINSEL0 & ~U1_PINMASK) | U1_PINSEL;
-
+
U1IER = 0x00; // disable all interrupts
}else if(minor==1){
// set the baudrate
- U1LCR = ULCR_DLAB_ENABLE; // select divisor latches
+ U1LCR = ULCR_DLAB_ENABLE; // select divisor latches
U1DLL = (uint8_t)baud; // set for baud low byte
U1DLM = (uint8_t)(baud >> 8); // set for baud high byte
-
+
// set the number of characters and other
// user specified operating parameters
U1LCR = (mode & ~ULCR_DLAB_ENABLE);
U1FCR = mode>>8;/*fifo mode*/
}
-
+
#endif
}
@@ -253,7 +253,7 @@ static void uart_write_polled(int minor, char c)
}
/* This is for setting baud rate, bits, etc. */
-static int uart_set_attributes(int minor, const struct termios *t)
+static int uart_set_attributes(int minor, const struct termios *t)
{
return 0;
}
@@ -264,7 +264,7 @@ static int uart_set_attributes(int minor, const struct termios *t)
* functions use them instead.
*/
/***********************************************************************/
-/*
+/*
* Read from UART. This is used in the exit code, and can't
* rely on interrupts.
*/
@@ -275,7 +275,7 @@ int uart_poll_read(int minor)
/*
- * Write a character to the console. This is used by printk() and
+ * Write a character to the console. This is used by printk() and
* maybe other low level functions. It should not use interrupts or any
* RTEMS system calls. It needs to be very simple
*/
@@ -300,29 +300,29 @@ BSP_polling_getchar_function_type BSP_poll_char = _BSP_get_char;
* init USART 0ĄŁ8 bit, 1 Stop,No checkout, BPS115200
****************************************************************************/
void UART0_Ini(void)
-{
+{
long Fdiv;
int i;
PINSEL0 = 0x00000005; // I/O to UART0
U0LCR = 0x83; // DLAB = 1
Fdiv = (Fpclk >>4) / UART_BPS; // configure BPS
- U0DLM = Fdiv/256;
- U0DLL = Fdiv%256;
+ U0DLM = Fdiv/256;
+ U0DLL = Fdiv%256;
U0LCR = 0x03;
for(i=0;i<10;i++){
U0THR = 67; //send a C to see if is OK
while( (U0LSR&0x40)==0 );
- }
+ }
}
-
+
/****************************************************************************
*Send a Byte
****************************************************************************/
void UART0_SendByte(char data)
-{
- U0THR = data;
+{
+ U0THR = data;
while( (U0LSR&0x40)==0 );
}
diff --git a/c/src/lib/libbsp/arm/rtl22xx/include/bsp.h b/c/src/lib/libbsp/arm/rtl22xx/include/bsp.h
index 5ac412a8b3..99e76efa0b 100644
--- a/c/src/lib/libbsp/arm/rtl22xx/include/bsp.h
+++ b/c/src/lib/libbsp/arm/rtl22xx/include/bsp.h
@@ -2,7 +2,7 @@
* Philips LPC22XX/LPC21xx BSP header file
*
* by Ray,Xu <Rayx.cn@gmail.com>
- *
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
*
@@ -26,7 +26,7 @@ extern "C" {
#include <rtems/clockdrv.h>
-#define CONFIG_ARM_CLK 60000000L
+#define CONFIG_ARM_CLK 60000000L
/* cclk=cco/(2*P) */
/* cco = cclk*2*P */
@@ -77,7 +77,7 @@ extern "C" {
// Core clk [Hz]
#define FCCLK FOSC<<2
/**
-* help file
+* help file
*/
/* System configure, Fosc Fcclk Fcco Fpclk must be defined*/
#define Fosc 11059200 // osc freq,10MHz~25MHz,
diff --git a/c/src/lib/libbsp/arm/rtl22xx/start/start.S b/c/src/lib/libbsp/arm/rtl22xx/start/start.S
index e9dda78838..c0001eb7b0 100644
--- a/c/src/lib/libbsp/arm/rtl22xx/start/start.S
+++ b/c/src/lib/libbsp/arm/rtl22xx/start/start.S
@@ -16,7 +16,7 @@
#warning The call is "void boot_card(const char* cmdline);"
#warning You need to pass a NULL.
#warning Please check and remove these warnings.
-
+
/* Some standard definitions...*/
/* Some standard definitions...*/
@@ -36,14 +36,14 @@
.code 32
.globl _start
_start:
- /*
+ /*
* Since I don't plan to return to the bootloader,
* I don't have to save the registers.
*
- * I'll just set the CPSR for SVC mode, interrupts
+ * I'll just set the CPSR for SVC mode, interrupts
* off, and ARM instructions.
*/
-
+
/* --- Initialize stack pointer registers */
/* Enter IRQ mode and set up the IRQ stack pointer */
mov r0, #(PSR_MODE_IRQ | PSR_I | PSR_F) /* No interrupts */
@@ -65,11 +65,11 @@ _start:
mov r0, #(PSR_MODE_ABT | PSR_I | PSR_F) /* No interrupts */
bic r0, r0, #PSR_T
msr cpsr, r0
- bic r0, r0, #PSR_T
+ bic r0, r0, #PSR_T
ldr r1, =_abt_stack_size
ldr sp, =_abt_stack
add sp, sp, r1
-
+
/* Set up the SVC stack pointer last and stay in SVC mode */
mov r0, #(PSR_MODE_SVC | PSR_I | PSR_F) /* No interrupts */
bic r0, r0, #PSR_T
@@ -77,18 +77,18 @@ _start:
ldr r1, =_svc_stack_size
ldr sp, =_svc_stack
add sp, sp, r1
- sub sp, sp, #0x64
-
- /*
+ sub sp, sp, #0x64
+
+ /*
* Initialize the exception vectors. This includes the
- * exceptions vectors (0x00000000-0x0000001c), and the
+ * exceptions vectors (0x00000000-0x0000001c), and the
* pointers to the exception handlers (0x00000020-0x0000003c).
*/
mov r0, #0
adr r1, vector_block
ldmia r1!, {r2-r9}
stmia r0!, {r2-r9}
-
+
ldmia r1!, {r2-r9}
stmia r0!, {r2-r9}
@@ -97,11 +97,11 @@ _start:
ldr r1, =_bss_end_
ldr r0, =_bss_start_
-_bss_init:
+_bss_init:
mov r2, #0
cmp r0, r1
strlot r2, [r0], #4
- blo _bss_init /* loop while r0 < r1 */
+ blo _bss_init /* loop while r0 < r1 */
#ifdef __thumb__
@@ -112,7 +112,7 @@ _bss_init:
bl boot_card
- /*
+ /*
* Theoretically, we could return to what started us up,
* but we'd have to have saved the registers and stacks.
* Instead, we'll just reset.
@@ -172,8 +172,8 @@ FIQ_Handler:
-
-/*
+
+/*
* This is the exception vector table and the pointers to
* the functions that handle the exceptions. It's a total
* of 16 words (64 bytes)
@@ -181,7 +181,7 @@ FIQ_Handler:
/*******************************************************
-vector_block:
+vector_block:
ldr pc, Reset_Handler
ldr pc, Undefined_Handler
ldr pc, SWI_Handler
@@ -193,7 +193,7 @@ vector_block:
Reset_Handler: b bsp_reset
Undefined_Handler: b Undefined_Handler
-SWI_Handler: b SWI_Handler
+SWI_Handler: b SWI_Handler
Prefetch_Handler: b Prefetch_Handler
Abort_Handler: b Abort_Handler
nop
diff --git a/c/src/lib/libbsp/arm/rtl22xx/startup/bspreset.c b/c/src/lib/libbsp/arm/rtl22xx/startup/bspreset.c
index 2bad09cd68..0908888abb 100644
--- a/c/src/lib/libbsp/arm/rtl22xx/startup/bspreset.c
+++ b/c/src/lib/libbsp/arm/rtl22xx/startup/bspreset.c
@@ -29,9 +29,9 @@ void bsp_reset(void)
"bx %[tmp] \n" \
"nop \n" \
: [tmp]"=&r" (tmp) );
- #else
+ #else
asm volatile ("b _start");
- #endif
+ #endif
while(1);
#endif
}
diff --git a/c/src/lib/libbsp/arm/shared/abort/abort.c b/c/src/lib/libbsp/arm/shared/abort/abort.c
index 3d78a5cd94..3bd704c32e 100644
--- a/c/src/lib/libbsp/arm/shared/abort/abort.c
+++ b/c/src/lib/libbsp/arm/shared/abort/abort.c
@@ -9,9 +9,9 @@
*
* Copyright (c) 2002 Advent Networks, Inc
* Jay Monkman <jmonkman@adventnetworks.com>
- *
+ *
* If you want a small footprint RTEMS, pls use simple_abort.c
- *
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
@@ -58,7 +58,7 @@ char *_print_full_context_mode2txt[0x20]={
[0xb]="undef", /* Undefined */
[0xf]="system" /* System */
};
-
+
void _print_full_context(uint32_t spsr)
{
@@ -94,13 +94,13 @@ void _print_full_context(uint32_t spsr)
}
-/* This function is supposed to figure out what caused the
+/* This function is supposed to figure out what caused the
* data abort, do that, then return.
*
* All unhandled instructions cause the system to hang.
*/
-void do_data_abort(uint32_t insn, uint32_t spsr,
+void do_data_abort(uint32_t insn, uint32_t spsr,
Context_Control *ctx)
{
/* Clarify, which type is correct, CPU_Exception_frame or Context_Control */
@@ -110,7 +110,7 @@ void do_data_abort(uint32_t insn, uint32_t spsr,
g_data_abort_insn_list[g_data_abort_cnt & 0x3ff] = ctx->register_lr - 8;
g_data_abort_cnt++;
-
+
decode = ((insn >> 20) & 0xff);
insn_type = decode & INSN_MASK;
@@ -143,7 +143,7 @@ void do_data_abort(uint32_t insn, uint32_t spsr,
printk("\n\nUnrecognized instruction\n");
break;
}
-
+
printk("data_abort at address 0x%x, instruction: 0x%x, spsr = 0x%x\n",
ctx->register_lr - 8, insn, spsr);
diff --git a/c/src/lib/libbsp/arm/shared/abort/simple_abort.c b/c/src/lib/libbsp/arm/shared/abort/simple_abort.c
index e3c6b1cab3..25f6aee4e5 100644
--- a/c/src/lib/libbsp/arm/shared/abort/simple_abort.c
+++ b/c/src/lib/libbsp/arm/shared/abort/simple_abort.c
@@ -11,7 +11,7 @@
* Jay Monkman <jmonkman@adventnetworks.com>
*
* This is a simple implement of abort
- *
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
@@ -99,7 +99,7 @@ void _print_full_context(uint32_t spsr)
}
-/* This function is supposed to figure out what caused the
+/* This function is supposed to figure out what caused the
* data abort, do that, then return.
*
* All unhandled instructions cause the system to hang.
@@ -107,7 +107,7 @@ void _print_full_context(uint32_t spsr)
void do_data_abort(
uint32_t insn,
- uint32_t spsr,
+ uint32_t spsr,
Context_Control *ctx
)
{
@@ -149,7 +149,7 @@ void do_data_abort(
printk("\n\nUnrecognized instruction\n");
break;
}
-
+
printk("data_abort at address 0x%x, instruction: 0x%x, spsr = 0x%x\n",
ctx->register_lr - 8, insn, spsr);
diff --git a/c/src/lib/libbsp/lm32/lm32_evr/include/bsp.h b/c/src/lib/libbsp/lm32/lm32_evr/include/bsp.h
index 1bdc0ba359..a7674f9866 100644
--- a/c/src/lib/libbsp/lm32/lm32_evr/include/bsp.h
+++ b/c/src/lib/libbsp/lm32/lm32_evr/include/bsp.h
@@ -40,7 +40,7 @@ extern "C" {
/*
* lm32 requires certain aligment of mbuf because unaligned uint32_t
* accesses are not handled properly.
- */
+ */
#define CPU_U32_FIX
@@ -51,8 +51,8 @@ extern int rtems_tsmac_driver_attach(struct rtems_bsdnet_ifconfig *config,
#define RTEMS_BSP_NETWORK_DRIVER_NAME "TSMAC0"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_tsmac_driver_attach
- /*
- * Due to a hardware design error (RJ45 connector with 10baseT magnetics)
+ /*
+ * Due to a hardware design error (RJ45 connector with 10baseT magnetics)
* we are forced to use 10baseT mode.
*/
diff --git a/c/src/lib/libbsp/lm32/lm32_evr/include/coverhd.h b/c/src/lib/libbsp/lm32/lm32_evr/include/coverhd.h
index 553784b6c4..99528913d6 100644
--- a/c/src/lib/libbsp/lm32/lm32_evr/include/coverhd.h
+++ b/c/src/lib/libbsp/lm32/lm32_evr/include/coverhd.h
@@ -2,9 +2,9 @@
*
* This include file has defines to represent the overhead associated
* with calling a particular directive from C. These are used in the
- * Timing Test Suite to ignore the overhead required to pass arguments
- * to directives. On some CPUs and/or target boards, this overhead
- * is significant and makes it difficult to distinguish internal
+ * Timing Test Suite to ignore the overhead required to pass arguments
+ * to directives. On some CPUs and/or target boards, this overhead
+ * is significant and makes it difficult to distinguish internal
* RTEMS execution time from that used to call the directive.
* This file should be updated after running the C overhead timing
* test. Once this update has been performed, the RTEMS Time Test
diff --git a/c/src/lib/libbsp/lm32/shared/clock/ckinit.c b/c/src/lib/libbsp/lm32/shared/clock/ckinit.c
index 6f2c4aa127..22bd484706 100644
--- a/c/src/lib/libbsp/lm32/shared/clock/ckinit.c
+++ b/c/src/lib/libbsp/lm32/shared/clock/ckinit.c
@@ -60,12 +60,12 @@ void Clock_driver_support_initialize_hardware(void)
clockwrite(LM32_CLOCK_PERIOD,
(CPU_FREQUENCY /
(1000000 / rtems_configuration_get_microseconds_per_tick())));
-
+
/* Enable clock interrupts and start in continuous mode */
- clockwrite(LM32_CLOCK_CR, LM32_CLOCK_CR_ITO |
- LM32_CLOCK_CR_CONT |
+ clockwrite(LM32_CLOCK_CR, LM32_CLOCK_CR_ITO |
+ LM32_CLOCK_CR_CONT |
LM32_CLOCK_CR_START);
-
+
lm32_interrupt_unmask(CLOCK_IRQMASK);
}
diff --git a/c/src/lib/libbsp/lm32/shared/console/uart.c b/c/src/lib/libbsp/lm32/shared/console/uart.c
index a67f8092aa..a35c17b9fd 100644
--- a/c/src/lib/libbsp/lm32/shared/console/uart.c
+++ b/c/src/lib/libbsp/lm32/shared/console/uart.c
@@ -40,7 +40,7 @@ void BSP_uart_init(int baud)
uartwrite(LM32_UART_MCR, LM32_UART_MCR_DTR | LM32_UART_MCR_RTS);
/* Set baud rate */
- uartwrite(LM32_UART_DIV, CPU_FREQUENCY/baud);
+ uartwrite(LM32_UART_DIV, CPU_FREQUENCY/baud);
}
void BSP_uart_polled_write(char ch)
diff --git a/c/src/lib/libbsp/lm32/shared/gdbstub/lm32-debug.S b/c/src/lib/libbsp/lm32/shared/gdbstub/lm32-debug.S
index d4d28f68fa..06600972a2 100644
--- a/c/src/lib/libbsp/lm32/shared/gdbstub/lm32-debug.S
+++ b/c/src/lib/libbsp/lm32/shared/gdbstub/lm32-debug.S
@@ -2,7 +2,7 @@
* lm32 debug exception vectors
*
* Michael Walle <michael@walle.cc>, 2009
- *
+ *
* If debugging is enabled the debug exception base address (deba) gets
* remapped to this file.
*
@@ -175,14 +175,14 @@ debug_isr_handler:
call r3
3:
lw r1, (sp+4)
- lw r2, (sp+8)
- lw r3, (sp+12)
- lw r4, (sp+16)
- lw r5, (sp+20)
- lw r6, (sp+24)
- lw r7, (sp+28)
- lw r8, (sp+32)
- lw r9, (sp+36)
+ lw r2, (sp+8)
+ lw r3, (sp+12)
+ lw r4, (sp+16)
+ lw r5, (sp+20)
+ lw r6, (sp+24)
+ lw r7, (sp+28)
+ lw r8, (sp+32)
+ lw r9, (sp+36)
lw r10, (sp+40)
lw ra, (sp+44)
lw ea, (sp+48)
@@ -208,7 +208,7 @@ debug_isr_handler:
wcsr EBA, ea
lw ea, (sp+140)
wcsr DEBA, ea
- /* Restore EA from PC */
+ /* Restore EA from PC */
lw ea, (sp+128)
/* Stack pointer must be restored last, in case it has been updated */
lw sp, (sp+124)
@@ -254,7 +254,7 @@ save_all:
sw (r0+140), r1
rcsr r1, IE
sw (r0+144), r1
-
+
/* Work out EID from exception entry point address */
andi r1, ra, 0xff
srui r1, r1, 5
@@ -274,14 +274,14 @@ save_all:
/* Restore gp registers */
restore_gp:
lw r1, (r0+4)
- lw r2, (r0+8)
- lw r3, (r0+12)
- lw r4, (r0+16)
- lw r5, (r0+20)
- lw r6, (r0+24)
- lw r7, (r0+28)
- lw r8, (r0+32)
- lw r9, (r0+36)
+ lw r2, (r0+8)
+ lw r3, (r0+12)
+ lw r4, (r0+16)
+ lw r5, (r0+20)
+ lw r6, (r0+24)
+ lw r7, (r0+28)
+ lw r8, (r0+32)
+ lw r9, (r0+36)
lw r10, (r0+40)
lw r11, (r0+44)
lw r12, (r0+48)
@@ -315,7 +315,7 @@ e_restore_and_return:
wcsr EBA, ea
lw ea, (r0+140)
wcsr DEBA, ea
- /* Restore EA from PC */
+ /* Restore EA from PC */
lw ea, (r0+128)
xor r0, r0, r0
eret
@@ -333,7 +333,7 @@ b_restore_and_return:
wcsr EBA, ba
lw ba, (r0+140)
wcsr DEBA, ba
- /* Restore BA from PC */
+ /* Restore BA from PC */
lw ba, (r0+128)
xor r0, r0, r0
bret
diff --git a/c/src/lib/libbsp/lm32/shared/gdbstub/lm32-stub.c b/c/src/lib/libbsp/lm32/shared/gdbstub/lm32-stub.c
index eeba61d1be..b1d453e691 100644
--- a/c/src/lib/libbsp/lm32/shared/gdbstub/lm32-stub.c
+++ b/c/src/lib/libbsp/lm32/shared/gdbstub/lm32-stub.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-
+
#include <bsp.h>
#include <string.h>
#include <signal.h>
@@ -70,13 +70,13 @@ static char remcomInBuffer[BUFMAX];
static char remcomOutBuffer[BUFMAX];
/*
- * Set by debugger to indicate that when handling memory faults (bus errors), the
+ * Set by debugger to indicate that when handling memory faults (bus errors), the
* handler should set the mem_err flag and skip over the faulting instruction
*/
static volatile int may_fault;
/*
- * Set by bus error exception handler, this indicates to caller of mem2hex,
+ * Set by bus error exception handler, this indicates to caller of mem2hex,
* hex2mem or bin2mem that there has been an error.
*/
static volatile int mem_err;
@@ -88,7 +88,7 @@ static char branch_step;
/* Saved instructions */
static unsigned int *seq_ptr;
static unsigned int seq_insn;
-static unsigned int *branch_ptr;
+static unsigned int *branch_ptr;
static unsigned int branch_insn;
#if defined(GDB_STUB_ENABLE_THREAD_SUPPORT)
@@ -144,7 +144,7 @@ static char *mem2hex(
)
{
unsigned char ch;
-
+
while (count-- > 0)
{
ch = *mem++;
@@ -178,7 +178,7 @@ static unsigned char *hex2mem(
ch |= hex(*buf++);
/* Attempt to write data to memory */
*mem++ = ch;
- /* Return NULL if write caused an exception */
+ /* Return NULL if write caused an exception */
if (mem_err)
return NULL;
}
@@ -204,11 +204,11 @@ static unsigned char *bin2mem(
c = *buf++;
if (c == 0x7d)
c = *buf++ ^ 0x20;
- /* Attempt to write value to memory */
+ /* Attempt to write value to memory */
*mem++ = c;
- /* Return NULL if write caused an exception */
+ /* Return NULL if write caused an exception */
if (mem_err)
- return NULL;
+ return NULL;
}
return mem;
@@ -262,7 +262,7 @@ static int compute_signal(
return SIGSEGV;
case LM32_EXCEPTION_DIVIDE_BY_ZERO:
return SIGFPE;
- }
+ }
return SIGHUP; /* default for things we don't know about */
}
@@ -293,7 +293,7 @@ retry:
if (ch == '$')
goto retry;
if (ch == '#')
- break;
+ break;
checksum = checksum + ch;
buffer[count] = ch;
count = count + 1;
@@ -366,19 +366,19 @@ static void putpacket(
* as the character we just transmitted
*/
run_length = 0;
- run_idx = count;
+ run_idx = count;
while ((buffer[run_idx++] == ch) && (run_length < 97))
run_length++;
/* Encode run length as an ASCII character */
run_length_char = (char)(run_length + 29);
- if ( (run_length >= 3)
+ if ( (run_length >= 3)
&& (run_length_char != '$')
&& (run_length_char != '#')
&& (run_length_char != '+')
&& (run_length_char != '-')
)
{
- /* Transmit run-length */
+ /* Transmit run-length */
gdb_put_debug_char('*');
checksum += '*';
gdb_put_debug_char(run_length_char);
@@ -394,7 +394,7 @@ static void putpacket(
count += 1;
}
#endif
-
+
gdb_put_debug_char('#');
gdb_put_debug_char(highhex(checksum));
gdb_put_debug_char(lowhex(checksum));
@@ -424,11 +424,11 @@ static void flush_cache(void)
__asm__ __volatile__ ("wcsr ICC, r0\n"
"nop\n"
"nop\n"
- "nop\n"
+ "nop\n"
"wcsr DCC, r0\n"
"nop\n"
"nop\n"
- "nop"
+ "nop"
);
}
@@ -439,35 +439,35 @@ static int set_hw_breakpoint(
)
{
int bp;
-
- /* Find a free break point register and then set it */
+
+ /* Find a free break point register and then set it */
__asm__ ("rcsr %0, BP0" : "=r" (bp));
- if ((bp & 0x01) == 0)
+ if ((bp & 0x01) == 0)
{
__asm__ ("wcsr BP0, %0" : : "r" (address | 1));
return 1;
}
__asm__ ("rcsr %0, BP1" : "=r" (bp));
- if ((bp & 0x01) == 0)
+ if ((bp & 0x01) == 0)
{
__asm__ ("wcsr BP1, %0" : : "r" (address | 1));
return 1;
}
__asm__ ("rcsr %0, BP2" : "=r" (bp));
- if ((bp & 0x01) == 0)
+ if ((bp & 0x01) == 0)
{
__asm__ ("wcsr BP2, %0" : : "r" (address | 1));
return 1;
}
__asm__ ("rcsr %0, BP3" : "=r" (bp));
- if ((bp & 0x01) == 0)
+ if ((bp & 0x01) == 0)
{
__asm__ ("wcsr BP3, %0" : : "r" (address | 1));
return 1;
}
/* No free breakpoint registers */
- return -1;
+ return -1;
}
/* Remove a h/w breakpoint which should be set at the given address */
@@ -477,28 +477,28 @@ static int disable_hw_breakpoint(
)
{
int bp;
-
+
/* Try to find matching breakpoint register */
__asm__ ("rcsr %0, BP0" : "=r" (bp));
- if ((bp & 0xfffffffc) == (address & 0xfffffffc))
+ if ((bp & 0xfffffffc) == (address & 0xfffffffc))
{
__asm__ ("wcsr BP0, %0" : : "r" (0));
return 1;
}
__asm__ ("rcsr %0, BP1" : "=r" (bp));
- if ((bp & 0xfffffffc) == (address & 0xfffffffc))
+ if ((bp & 0xfffffffc) == (address & 0xfffffffc))
{
__asm__ ("wcsr BP1, %0" : : "r" (0));
return 1;
}
__asm__ ("rcsr %0, BP2" : "=r" (bp));
- if ((bp & 0xfffffffc) == (address & 0xfffffffc))
+ if ((bp & 0xfffffffc) == (address & 0xfffffffc))
{
__asm__ ("wcsr BP2, %0" : : "r" (0));
return 1;
}
__asm__ ("rcsr %0, BP3" : "=r" (bp));
- if ((bp & 0xfffffffc) == (address & 0xfffffffc))
+ if ((bp & 0xfffffffc) == (address & 0xfffffffc))
{
__asm__ ("wcsr BP3, %0" : : "r" (0));
return 1;
@@ -519,10 +519,10 @@ static void gdb_stub_report_exception_info(
char *ptr;
int sigval;
- /* Convert exception ID to a signal number */
+ /* Convert exception ID to a signal number */
sigval = compute_signal(registers[LM32_REG_EID]);
- /* Set pointer to start of output buffer */
+ /* Set pointer to start of output buffer */
ptr = remcomOutBuffer;
*ptr++ = 'T';
@@ -585,7 +585,7 @@ void handle_exception(void)
thread = rtems_gdb_stub_get_current_thread();
#endif
current_thread = thread;
-
+
/*
* Check for bus error caused by this code (rather than the program being
* debugged)
@@ -604,10 +604,10 @@ void handle_exception(void)
{
/* Remove breakpoints */
*seq_ptr = seq_insn;
- if (branch_step)
- *branch_ptr = branch_insn;
+ if (branch_step)
+ *branch_ptr = branch_insn;
stepping = 0;
- }
+ }
/* Reply to host that an exception has occured with some basic info */
gdb_stub_report_exception_info(thread);
@@ -639,7 +639,7 @@ void handle_exception(void)
if (do_threads && current_thread != thread )
regptr = &current_thread_registers;
#endif
- ptr = mem2hex((unsigned char*)regptr, remcomOutBuffer, NUM_REGS * 4);
+ ptr = mem2hex((unsigned char*)regptr, remcomOutBuffer, NUM_REGS * 4);
break;
/* Set the value of the CPU registers */
@@ -649,7 +649,7 @@ void handle_exception(void)
if (do_threads && current_thread != thread )
regptr = &current_thread_registers;
#endif
- hex2mem(ptr, (unsigned char*)regptr, NUM_REGS * 4);
+ hex2mem(ptr, (unsigned char*)regptr, NUM_REGS * 4);
strcpy(remcomOutBuffer, "OK");
break;
@@ -724,7 +724,7 @@ void handle_exception(void)
registers[LM32_REG_PC] = addr;
flush_cache();
return;
-
+
/* Step */
case 's':
/* try to read optional parameter, pc unchanged if no parm */
@@ -736,32 +736,32 @@ void handle_exception(void)
opcode = insn & 0xfc000000;
if ( (opcode == 0xe0000000)
|| (opcode == 0xf8000000)
- )
+ )
{
branch_step = 1;
branch_target = registers[LM32_REG_PC]
+ (((signed)insn << 6) >> 4);
- }
+ }
else if ( (opcode == 0x44000000)
- || (opcode == 0x48000000)
- || (opcode == 0x4c000000)
- || (opcode == 0x50000000)
- || (opcode == 0x54000000)
- || (opcode == 0x5c000000)
- )
+ || (opcode == 0x48000000)
+ || (opcode == 0x4c000000)
+ || (opcode == 0x50000000)
+ || (opcode == 0x54000000)
+ || (opcode == 0x5c000000)
+ )
{
branch_step = 1;
branch_target = registers[LM32_REG_PC] +
+ (((signed)insn << 16) >> 14);
}
else if ( (opcode == 0xd8000000)
- || (opcode == 0xc0000000)
+ || (opcode == 0xc0000000)
)
{
branch_step = 1;
branch_target = registers[(insn >> 21) & 0x1f];
- }
- else
+ }
+ else
branch_step = 0;
/* Set breakpoint after instruction we're stepping */
@@ -769,7 +769,7 @@ void handle_exception(void)
seq_ptr++;
seq_insn = *seq_ptr;
*seq_ptr = LM32_BREAK;
-
+
/* Make sure one insn doesn't get replaced twice */
if (seq_ptr == (unsigned int*)branch_target)
branch_step = 0;
@@ -805,7 +805,7 @@ void handle_exception(void)
break;
}
break;
-
+
case 'z':
switch (*ptr++)
{
@@ -820,11 +820,11 @@ void handle_exception(void)
if (err > 0)
strcpy(remcomOutBuffer, "OK");
else if (err < 0)
- strcpy(remcomOutBuffer, "E28");
- }
+ strcpy(remcomOutBuffer, "E28");
+ }
else
strcpy(remcomOutBuffer, "E22");
- break;
+ break;
}
break;
@@ -858,7 +858,7 @@ void handle_exception(void)
}
break;
#endif
-
+
/* Set thread */
case 'H':
#if defined(GDB_STUB_ENABLE_THREAD_SUPPORT)
@@ -923,8 +923,8 @@ void handle_exception(void)
/* We reset by branching to the reset exception handler. */
registers[LM32_REG_PC] = 0;
return;
-#endif
- }
+#endif
+ }
/* reply to the request */
putpacket(remcomOutBuffer);
@@ -935,7 +935,7 @@ void gdb_handle_break(rtems_vector_number vector, CPU_Interrupt_frame *frame)
{
int i;
unsigned int *int_regs = (unsigned int*)frame;
-
+
/* copy extended frame to registers */
registers[LM32_REG_R0] = 0;
for (i = 1; i < NUM_REGS; i++)
@@ -957,13 +957,13 @@ void gdb_handle_break(rtems_vector_number vector, CPU_Interrupt_frame *frame)
void lm32_gdb_stub_install(int enable_threads)
{
unsigned int dc;
-
+
/* set DEBA and remap all exception */
__asm__("wcsr DEBA, %0" : : "r" (&_deba));
__asm__("rcsr %0, DC" : "=r" (dc));
dc |= 0x2;
__asm__("wcsr DC, %0" : : "r" (dc));
-
+
#if defined(GDB_STUB_ENABLE_THREAD_SUPPORT)
if( enable_threads )
do_threads = 1;
diff --git a/c/src/lib/libbsp/lm32/shared/start/start.S b/c/src/lib/libbsp/lm32/shared/start/start.S
index 5358d9a481..f1cb309c95 100644
--- a/c/src/lib/libbsp/lm32/shared/start/start.S
+++ b/c/src/lib/libbsp/lm32/shared/start/start.S
@@ -29,9 +29,9 @@
.globl crt0
.type crt0,@function
-LatticeDDInit:
-__start:
-_start:
+LatticeDDInit:
+__start:
+_start:
start:
/* Clear r0 */
xor r0,r0,r0
@@ -51,7 +51,7 @@ start:
breakpoint_handler:
rcsr r7, DEBA
addi r7, r7, 32
- b r7
+ b r7
nop
nop
nop
@@ -60,7 +60,7 @@ breakpoint_handler:
instruction_bus_error_handler:
rcsr r7, DEBA
addi r7, r7, 64
- b r7
+ b r7
nop
nop
nop
@@ -69,7 +69,7 @@ instruction_bus_error_handler:
watchpoint_handler:
rcsr r7, DEBA
addi r7, r7, 96
- b r7
+ b r7
nop
nop
nop
@@ -78,7 +78,7 @@ watchpoint_handler:
data_bus_error_handler:
rcsr r7, DEBA
addi r7, r7, 128
- b r7
+ b r7
nop
nop
nop
@@ -87,7 +87,7 @@ data_bus_error_handler:
divide_by_zero_handler:
rcsr r7, DEBA
addi r7, r7, 160
- b r7
+ b r7
nop
nop
nop
@@ -106,14 +106,14 @@ interrupt_handler:
system_call_handler:
rcsr r7, DEBA
addi r7, r7, 224
- b r7
+ b r7
nop
nop
nop
nop
nop
-crt0:
+crt0:
/* Flush data cache */
addi r1, r0, 1
wcsr DCC, r1
@@ -153,7 +153,7 @@ crt0:
#define SYS_exit 1
mvi r8, SYS_exit
- scall
+ scall
#endif
.dead_end:
diff --git a/c/src/lib/libbsp/lm32/shared/tsmac/tsmac.c b/c/src/lib/libbsp/lm32/shared/tsmac/tsmac.c
index 6be2e74110..568b413058 100644
--- a/c/src/lib/libbsp/lm32/shared/tsmac/tsmac.c
+++ b/c/src/lib/libbsp/lm32/shared/tsmac/tsmac.c
@@ -230,11 +230,11 @@ static void tsmac_rxDaemon(void *arg)
for(;;)
{
- rtems_bsdnet_event_receive( RTEMS_ALL_EVENTS,
+ rtems_bsdnet_event_receive( RTEMS_ALL_EVENTS,
RTEMS_WAIT | RTEMS_EVENT_ANY,
- RTEMS_NO_TIMEOUT,
+ RTEMS_NO_TIMEOUT,
&events);
-
+
#ifdef DEBUG
printk(TSMAC_NAME ": tsmac_rxDaemon wakeup\n");
#endif
@@ -247,10 +247,10 @@ static void tsmac_rxDaemon(void *arg)
/* Get number of RX frames in RX FIFO */
rxq = tsmacread(LM32_TSMAC_RX_FRAMES_CNT);
-
+
if (rxq == 0)
break;
-
+
/* Get lenght of frame */
len = tsmacread(LM32_TSMAC_RX_LEN_FIFO);
#ifdef DEBUG
@@ -263,7 +263,7 @@ static void tsmac_rxDaemon(void *arg)
*/
MGETHDR(m, M_WAIT, MT_DATA);
MCLGET(m, M_WAIT);
-
+
m->m_pkthdr.rcvif = ifp;
buf = (uint32_t *) mtod(m, uint32_t*);
@@ -279,7 +279,7 @@ static void tsmac_rxDaemon(void *arg)
printk("\n");
#endif
- m->m_len = m->m_pkthdr.len =
+ m->m_len = m->m_pkthdr.len =
len - sizeof(uint32_t) - sizeof(struct ether_header);
eh = mtod(m, struct ether_header*);
m->m_data += sizeof(struct ether_header);
@@ -290,7 +290,7 @@ static void tsmac_rxDaemon(void *arg)
/* Notify the ip stack that there is a new packet */
ether_input(ifp, eh, m);
-
+
/*
* Release RX frame
*/
@@ -322,7 +322,7 @@ static void tsmac_sendpacket(struct ifnet *ifp, struct mbuf *m)
}
printk("\n");
#endif
-
+
if (nm->m_len > 0)
{
memcpy(&tsmac_txbuf[len], (char *)nm->m_data, nm->m_len);
@@ -394,7 +394,7 @@ static void tsmac_txDaemon(void *arg)
#endif
break;
}
-
+
/*
* Get the next mbuf chain to transmit.
*/
@@ -442,7 +442,7 @@ void tsmac_init_hardware(struct tsmac_softc *tsmac)
tsmacregread(LM32_TSMAC_MAC_ADDR_2_BYTE0));
printk(TSMAC_NAME ": MAC TX_RX_STS %04x\n",
tsmacregread(LM32_TSMAC_TX_RX_STS_BYTE0));
-#endif
+#endif
/*
* Set our physical address
@@ -460,12 +460,12 @@ void tsmac_init_hardware(struct tsmac_softc *tsmac)
tsmacregread(LM32_TSMAC_MAC_ADDR_1_BYTE0));
printk(TSMAC_NAME ": MAC MAC_ADDR2 %04x\n",
tsmacregread(LM32_TSMAC_MAC_ADDR_2_BYTE0));
-#endif
+#endif
/*
* Configure PHY
*/
-
+
phyid = tsmacphyread(PHY_PHYIDR1);
#ifdef DEBUG
printk(TSMAC_NAME ": PHYIDR1 %08x\n", phyid);
@@ -491,7 +491,7 @@ void tsmac_init_hardware(struct tsmac_softc *tsmac)
tsmacphywrite(PHY_ANAR, PHY_ANAR_10_FD | PHY_ANAR_10 | PHY_ANAR_SEL_DEF);
stat = tsmacphyread(PHY_ANAR);
#ifdef DEBUG
- printk(TSMAC_NAME ": PHY ANAR %04x, wrote %04x\n", stat,
+ printk(TSMAC_NAME ": PHY ANAR %04x, wrote %04x\n", stat,
PHY_ANAR_10_FD | PHY_ANAR_10 | PHY_ANAR_SEL_DEF);
#endif
#endif /* TSMAC_FORCE_10BASET */
@@ -501,7 +501,7 @@ void tsmac_init_hardware(struct tsmac_softc *tsmac)
#endif
/* Enable receive and transmit interrupts */
- tsmacwrite(LM32_TSMAC_INTR_ENB, INTR_ENB |
+ tsmacwrite(LM32_TSMAC_INTR_ENB, INTR_ENB |
INTR_RX_SMRY | INTR_TX_SMRY |
INTR_RX_PKT_RDY | INTR_TX_PKT_SENT);
}
@@ -541,13 +541,13 @@ void tsmac_init(void *arg)
/* Interrupt line for TSMAC */
lm32_interrupt_unmask(TSMAC_IRQMASK);
}
-
+
ifp->if_flags |= IFF_RUNNING;
-
+
/*
* Receive broadcast
*/
-
+
tsmacregwrite(LM32_TSMAC_TX_RX_CTL_BYTE0, TX_RX_CTL_RECEIVE_BRDCST |
TX_RX_CTL_RECEIVE_PAUSE);
@@ -557,7 +557,7 @@ void tsmac_init(void *arg)
* Enable receiver
*/
- tsmacregwrite(LM32_TSMAC_MODE_BYTE0, MODE_TX_EN | MODE_RX_EN | MODE_FC_EN);
+ tsmacregwrite(LM32_TSMAC_MODE_BYTE0, MODE_TX_EN | MODE_RX_EN | MODE_FC_EN);
/*
* Wake up receive task to receive packets in queue
@@ -767,7 +767,7 @@ int rtems_tsmac_driver_attach(struct rtems_bsdnet_ifconfig *config, int attachin
mtu = config->mtu;
else
mtu = ETHERMTU;
-
+
/*
* Set up network interface values
*/
@@ -811,7 +811,7 @@ rtems_isr tsmac_interrupt_handler(rtems_vector_number vector)
rx_stat = tsmacread(LM32_TSMAC_RX_STATUS);
if (rx_stat & STAT_RX_FIFO_FULL)
tsmac->rxFifoFull++;
-
+
tx_stat = tsmacread(LM32_TSMAC_TX_STATUS);
if (tx_stat & STAT_TX_FIFO_FULL)
tsmac->txFifoFull++;