More debugging
This commit is contained in:
parent
4a21f48e27
commit
9d23c476da
|
@ -19,7 +19,6 @@ void f_init(void){
|
|||
#include "core/ssp/ssp.h"
|
||||
|
||||
void f_status(void){
|
||||
int status;
|
||||
int dx=0;
|
||||
int dy=8;
|
||||
uint8_t buf[4];
|
||||
|
@ -31,22 +30,52 @@ void f_status(void){
|
|||
gpioSetDir(RB_SPI_NRF_CS, gpioDirection_Output);
|
||||
gpioSetPullup(&RB_SPI_NRF_CS_IO, gpioPullupMode_Inactive);
|
||||
|
||||
CS_LOW();
|
||||
gpioSetDir(RB_NRF_CE, gpioDirection_Output);
|
||||
gpioSetPullup(&RB_NRF_CE_IO, gpioPullupMode_Inactive);
|
||||
gpioSetValue(RB_NRF_CE, 0);
|
||||
|
||||
delayms(10);
|
||||
|
||||
buf[0]=C_W_REGISTER | R_CONFIG;
|
||||
buf[1]=R_CONFIG_PRIM_RX| R_CONFIG_PWR_UP| R_CONFIG_CRCO;
|
||||
// buf[0]=C_R_REGISTER | 5; buf[1]=10;
|
||||
// buf[0]=C_W_REGISTER | R_EN_AA; buf[1]=0x21;
|
||||
buf[2]=0;
|
||||
buf[3]=0;
|
||||
|
||||
dx=DoString(0,dy,"Snd:"); DoIntX(dx,dy,*(int*)buf);dy+=8;
|
||||
|
||||
sspSend(0, (uint8_t*) &buf, 2);
|
||||
sspReceive(0, &buf, 2);
|
||||
CS_LOW();
|
||||
delayms(10);
|
||||
sspSend(0, buf, 2);
|
||||
sspReceive(0, buf, 2);
|
||||
CS_HIGH();
|
||||
delayms(10);
|
||||
|
||||
dx=DoString(0,dy,"Rcv:"); DoIntX(dx,dy,*(int*)buf);dy+=8;
|
||||
|
||||
/*
|
||||
CS_LOW();
|
||||
status=nrf_cmd_status(C_NOP);
|
||||
CS_HIGH();
|
||||
dx=DoString(0,dy,"St:"); DoIntX(dx,dy,status); dy+=8;
|
||||
*/
|
||||
|
||||
buf[0]=C_R_REGISTER | R_CONFIG;
|
||||
// buf[0]=C_R_REGISTER | R_EN_AA;
|
||||
buf[1]=0;
|
||||
buf[2]=0;
|
||||
buf[3]=0;
|
||||
dx=DoString(0,dy,"S2:"); DoIntX(dx,dy,*(int*)buf);dy+=8;
|
||||
|
||||
CS_LOW();
|
||||
delayms(10);
|
||||
sspSend(0, buf, 2);
|
||||
sspReceive(0, buf, 2);
|
||||
CS_HIGH();
|
||||
delayms(10);
|
||||
|
||||
dx=DoString(0,dy,"R2:"); DoIntX(dx,dy,*(int*)buf);dy+=8;
|
||||
};
|
||||
|
||||
void f_recv(void){
|
||||
|
@ -79,8 +108,8 @@ const struct MENU_DEF menu_rcv = {"F Recv", &f_recv};
|
|||
const struct MENU_DEF menu_nop = {"---", NULL};
|
||||
|
||||
static menuentry menu[] = {
|
||||
&menu_init,
|
||||
&menu_status,
|
||||
&menu_init,
|
||||
&menu_rcv,
|
||||
&menu_nop,
|
||||
&menu_ISP,
|
||||
|
|
Loading…
Reference in New Issue