add proper "const" qualifiers

This commit is contained in:
Stefan `Sec` Zehl 2011-07-17 22:08:27 +02:00
parent 54e29bc10b
commit ea90f92ebb
4 changed files with 8 additions and 8 deletions

View File

@ -238,7 +238,7 @@ void sspInit (uint8_t portNum, sspClockPolarity_t polarity, sspClockPhase_t phas
Block length of the data buffer Block length of the data buffer
*/ */
/**************************************************************************/ /**************************************************************************/
void sspSend (uint8_t portNum, uint8_t *buf, uint32_t length) void sspSend (uint8_t portNum, const uint8_t *buf, uint32_t length)
{ {
uint32_t i; uint32_t i;
uint8_t Dummy = Dummy; uint8_t Dummy = Dummy;

View File

@ -79,7 +79,7 @@ sspClockPhase_t;
extern void SSP_IRQHandler (void); extern void SSP_IRQHandler (void);
void sspInit (uint8_t portNum, sspClockPolarity_t polarity, sspClockPhase_t phase); void sspInit (uint8_t portNum, sspClockPolarity_t polarity, sspClockPhase_t phase);
void sspSend (uint8_t portNum, uint8_t *buf, uint32_t length); void sspSend (uint8_t portNum, const uint8_t *buf, uint32_t length);
void sspReceive (uint8_t portNum, uint8_t *buf, uint32_t length); void sspReceive (uint8_t portNum, uint8_t *buf, uint32_t length);
void sspSendReceive(uint8_t portNum, uint8_t *buf, uint32_t length); void sspSendReceive(uint8_t portNum, uint8_t *buf, uint32_t length);
#endif #endif

View File

@ -81,7 +81,7 @@ void nrf_read_pkt_crc(int len, uint8_t* data, uint8_t* crc){
CS_HIGH(); CS_HIGH();
}; };
void nrf_write_long(const uint8_t cmd, int len, uint8_t* data){ void nrf_write_long(const uint8_t cmd, int len, const uint8_t* data){
CS_LOW(); CS_LOW();
xmit_spi(cmd); xmit_spi(cmd);
sspSend(0,data,len); sspSend(0,data,len);
@ -185,7 +185,7 @@ char nrf_snd_pkt_crc_encr(int size, uint8_t * pkt, uint32_t const key[4]){
return nrf_cmd_status(C_NOP); return nrf_cmd_status(C_NOP);
}; };
void nrf_set_rx_mac(int pipe, int rxlen, int maclen, uint8_t * mac){ void nrf_set_rx_mac(int pipe, int rxlen, int maclen, const uint8_t * mac){
#ifdef SAFE #ifdef SAFE
assert(maclen>=1 || maclen<=5); assert(maclen>=1 || maclen<=5);
assert(rxlen>=1 || rxlen<=32); assert(rxlen>=1 || rxlen<=32);
@ -202,7 +202,7 @@ void nrf_set_rx_mac(int pipe, int rxlen, int maclen, uint8_t * mac){
); );
}; };
void nrf_set_tx_mac(int maclen, uint8_t * mac){ void nrf_set_tx_mac(int maclen, const uint8_t * mac){
#ifdef SAFE #ifdef SAFE
assert(maclen>=1 || maclen<=5); assert(maclen>=1 || maclen<=5);
assert(mac!=NULL); assert(mac!=NULL);

View File

@ -145,10 +145,10 @@ void nrf_cmd_rw_long(uint8_t* data, int len);
void nrf_read_long(const uint8_t reg, int len, uint8_t* data); void nrf_read_long(const uint8_t reg, int len, uint8_t* data);
void nrf_write_reg(const uint8_t reg, const uint8_t val); void nrf_write_reg(const uint8_t reg, const uint8_t val);
uint8_t nrf_read_reg(const uint8_t reg); uint8_t nrf_read_reg(const uint8_t reg);
void nrf_write_reg_long(const uint8_t reg, int len, uint8_t* data); void nrf_write_long(const uint8_t cmd, int len, const uint8_t* data);
void nrf_set_rx_mac(int pipe, int rxlen, int maclen, uint8_t * mac); void nrf_set_rx_mac(int pipe, int rxlen, int maclen, const uint8_t * mac);
void nrf_set_tx_mac(int maclen, uint8_t * mac); void nrf_set_tx_mac(int maclen, const uint8_t * mac);
void nrf_disable_pipe(int pipe); void nrf_disable_pipe(int pipe);
void nrf_set_channel(int channel); void nrf_set_channel(int channel);