PERFORCE change 96664 for review
Warner Losh
imp at FreeBSD.org
Thu May 4 20:01:20 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=96664
Change 96664 by imp at imp_hammer on 2006/05/04 20:00:28
Slim down by about 160 bytes: a little better code and eliminate
the get ID command, since it is unused.
Affected files ...
.. //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.c#10 edit
Differences ...
==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.c#10 (text+ko) ====
@@ -73,14 +73,10 @@
static char
GetFlashStatus(void)
{
-
+ p_memset((char *)&spi_command, 0, sizeof(spi_command));
p_memset(tx_commandBuffer, 0, 8);
tx_commandBuffer[0] = STATUS_REGISTER_READ;
p_memset(rx_commandBuffer, 0, 8);
- spi_command.tx_data_size = 0;
- spi_command.tx_data = 0;
- spi_command.rx_data_size = 0;
- spi_command.rx_data = 0;
spi_command.tx_cmd = tx_commandBuffer;
spi_command.rx_cmd = rx_commandBuffer;
spi_command.rx_cmd_size = 2;
@@ -89,26 +85,6 @@
return (rx_commandBuffer[1]);
}
-void
-SPI_GetId(unsigned *id)
-{
-
- p_memset(tx_commandBuffer, 0, 8);
- tx_commandBuffer[0] = 0x9f;
- p_memset(rx_commandBuffer, 0, 8);
- spi_command.tx_data_size = 0;
- spi_command.tx_data = 0;
- spi_command.rx_data_size = 0;
- spi_command.rx_data = 0;
- spi_command.tx_cmd = tx_commandBuffer;
- spi_command.rx_cmd = rx_commandBuffer;
- spi_command.rx_cmd_size = 5;
- spi_command.tx_cmd_size = 5;
- SendCommand(&spi_command);
- *id = rx_commandBuffer[1] | (rx_commandBuffer[2] << 8) |
- (rx_commandBuffer[3] << 16);
-}
-
/*
* .KB_C_FN_DEFINITION_START
* void WaitForDeviceReady(void)
More information about the p4-projects
mailing list