modified nrf code to use sspSendReceive

This commit is contained in:
schneider 2011-07-06 09:59:08 +02:00
parent 1d6f1a3adc
commit a534cb9215
2 changed files with 7 additions and 10 deletions

View File

@ -157,8 +157,6 @@ void handleMenu(const struct MENU *the_menu) {
visible_lines--; // subtract title line visible_lines--; // subtract title line
while (!back) { while (!back) {
delayms(100);
uint8_t line = 0; uint8_t line = 0;
lcdFill(0); // clear display buffer lcdFill(0); // clear display buffer

View File

@ -39,8 +39,8 @@ void nrf_cmd(uint8_t cmd){
}; };
uint8_t nrf_cmd_status(uint8_t cmd){ uint8_t nrf_cmd_status(uint8_t cmd){
xmit_spi(cmd); sspSendReceive(0, &cmd, 1);
return rcvr_spi(); return cmd;
}; };
void nrf_write_reg(const uint8_t reg, const uint8_t val){ void nrf_write_reg(const uint8_t reg, const uint8_t val){
@ -64,13 +64,12 @@ void nrf_write_reg_long(const uint8_t reg, int len, char* data){
}; };
}; };
//XXX: Why is len a pointer?
void nrf_cmd_read_long(const uint8_t cmd, int *len, char* data){ void nrf_cmd_read_long(const uint8_t cmd, int *len, char* data){
xmit_spi(cmd); data[0] = 0xFF;
// do i need to read the status byte here? for(int i=1;i<*len;i++)
for(int i=0;i<*len;i++){ data[i] = 0x00;
xmit_spi(0); sspSendReceive(0,data,*len);
rcvr_spi_m(&data[i]);
};
}; };
void nrf_init() { void nrf_init() {