Merge branch 'master' of github.com:r0ket/r0ket
This commit is contained in:
commit
6f8e019dcf
|
@ -31,6 +31,7 @@ void main_default(void) {
|
||||||
break;
|
break;
|
||||||
case BTN_RIGHT:
|
case BTN_RIGHT:
|
||||||
GLOBAL(develmode)=1;
|
GLOBAL(develmode)=1;
|
||||||
|
applyConfig();
|
||||||
break;
|
break;
|
||||||
case BTN_DOWN:
|
case BTN_DOWN:
|
||||||
usbMSCInit();
|
usbMSCInit();
|
||||||
|
|
|
@ -19,3 +19,9 @@ void execute_menu(void){
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//# MENU |devel
|
||||||
|
void execute_devel(void){
|
||||||
|
while(getInput()!=BTN_NONE);
|
||||||
|
executeSelect("INT");
|
||||||
|
lcdRefresh();
|
||||||
|
};
|
||||||
|
|
|
@ -6,15 +6,19 @@
|
||||||
|
|
||||||
#include "lcd/render.h"
|
#include "lcd/render.h"
|
||||||
#include "lcd/print.h"
|
#include "lcd/print.h"
|
||||||
|
#include "lcd/image.h"
|
||||||
|
|
||||||
#include "usb/usbmsc.h"
|
#include "usb/usbmsc.h"
|
||||||
|
|
||||||
|
#include "filesystem/ff.h"
|
||||||
|
#include "filesystem/select.h"
|
||||||
|
|
||||||
#include "core/iap/iap.h"
|
#include "core/iap/iap.h"
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
//# MENU msc
|
//# MENU usb_storage
|
||||||
void msc_menu(void){
|
void msc_menu(void){
|
||||||
lcdClear();
|
lcdClear();
|
||||||
lcdPrintln("MSC Enabled.");
|
lcdPrintln("MSC Enabled.");
|
||||||
|
@ -46,3 +50,20 @@ void tick_alive(void){
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// //# MENU img img
|
||||||
|
void t_img(void){
|
||||||
|
char fname[FILENAMELEN];
|
||||||
|
selectFile(fname, "LCD");
|
||||||
|
lcdLoadImage(fname);
|
||||||
|
lcdRefresh();
|
||||||
|
getInputWait();
|
||||||
|
};
|
||||||
|
|
||||||
|
// //# MENU img anim
|
||||||
|
void t_ani(void){
|
||||||
|
char fname[FILENAMELEN];
|
||||||
|
selectFile(fname, "LCD");
|
||||||
|
lcdShowAnim(fname,1000);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <sysinit.h>
|
#include <sysinit.h>
|
||||||
|
|
||||||
#include "basic/basic.h"
|
#include "basic/basic.h"
|
||||||
|
#include "basic/config.h"
|
||||||
|
|
||||||
#include "lcd/print.h"
|
#include "lcd/print.h"
|
||||||
|
|
||||||
|
@ -11,7 +12,7 @@ uint8_t menuflags=0;
|
||||||
void handleMenu(const struct MENU *the_menu) {
|
void handleMenu(const struct MENU *the_menu) {
|
||||||
uint8_t back = 0;
|
uint8_t back = 0;
|
||||||
int8_t menuselection = 0;
|
int8_t menuselection = 0;
|
||||||
uint8_t numentries = 0;
|
uint8_t numentries;
|
||||||
uint8_t visible_lines = 0;
|
uint8_t visible_lines = 0;
|
||||||
uint8_t current_offset = 0;
|
uint8_t current_offset = 0;
|
||||||
|
|
||||||
|
@ -21,6 +22,9 @@ void handleMenu(const struct MENU *the_menu) {
|
||||||
|
|
||||||
for (numentries = 0; the_menu->entries[numentries].text != NULL ; numentries++);
|
for (numentries = 0; the_menu->entries[numentries].text != NULL ; numentries++);
|
||||||
|
|
||||||
|
if(the_menu->entries[numentries-1].text[0]=='|' && !GLOBAL(develmode))
|
||||||
|
numentries--;
|
||||||
|
|
||||||
visible_lines = lcdGetVisibleLines()-1; // subtract title line
|
visible_lines = lcdGetVisibleLines()-1; // subtract title line
|
||||||
|
|
||||||
if(menuflags&MENU_BIG)
|
if(menuflags&MENU_BIG)
|
||||||
|
@ -81,8 +85,8 @@ void handleMenu(const struct MENU *the_menu) {
|
||||||
break;
|
break;
|
||||||
case BTN_ENTER:
|
case BTN_ENTER:
|
||||||
lcdClear();
|
lcdClear();
|
||||||
lcdPrintln("Called...");
|
// lcdPrintln("Called...");
|
||||||
lcdRefresh();
|
// lcdRefresh();
|
||||||
getInputWaitRelease();
|
getInputWaitRelease();
|
||||||
if (the_menu->entries[menuselection].callback!=NULL)
|
if (the_menu->entries[menuselection].callback!=NULL)
|
||||||
the_menu->entries[menuselection].callback();
|
the_menu->entries[menuselection].callback();
|
||||||
|
@ -91,7 +95,7 @@ void handleMenu(const struct MENU *the_menu) {
|
||||||
if (menuflags&MENU_JUSTONCE)
|
if (menuflags&MENU_JUSTONCE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
getInputWait();
|
// getInputWait();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case BTN_NONE: /* timeout */
|
case BTN_NONE: /* timeout */
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
char meshgen=0; // Generation
|
char meshgen=0; // Generation
|
||||||
char meshincctr=0;
|
char meshincctr=0;
|
||||||
char meshmsg=0;
|
char meshmsg=0;
|
||||||
|
char meshnice=0;
|
||||||
MPKT meshbuffer[MESHBUFSIZE];
|
MPKT meshbuffer[MESHBUFSIZE];
|
||||||
|
|
||||||
uint32_t const meshkey[4] = {
|
uint32_t const meshkey[4] = {
|
||||||
|
@ -89,11 +90,19 @@ void mesh_sendloop(void){
|
||||||
else
|
else
|
||||||
uint32touint8p(0,MO_BODY(meshbuffer[0].pkt));
|
uint32touint8p(0,MO_BODY(meshbuffer[0].pkt));
|
||||||
|
|
||||||
|
MO_BODY(meshbuffer[0].pkt)[4]=meshnice;
|
||||||
|
|
||||||
for (int i=0;i<MESHBUFSIZE;i++){
|
for (int i=0;i<MESHBUFSIZE;i++){
|
||||||
if(!meshbuffer[i].flags&MF_USED)
|
if(!meshbuffer[i].flags&MF_USED)
|
||||||
continue;
|
continue;
|
||||||
if(meshbuffer[i].flags&MF_LOCK)
|
if(meshbuffer[i].flags&MF_LOCK)
|
||||||
continue;
|
continue;
|
||||||
|
if(meshnice&0xf){
|
||||||
|
if(getSeconds()%0xf < (meshnice&0x0f)){
|
||||||
|
meshincctr++;
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
};
|
||||||
ctr++;
|
ctr++;
|
||||||
memcpy(buf,meshbuffer[i].pkt,MESHPKTSIZE);
|
memcpy(buf,meshbuffer[i].pkt,MESHPKTSIZE);
|
||||||
status=nrf_snd_pkt_crc_encr(MESHPKTSIZE,buf,meshkey);
|
status=nrf_snd_pkt_crc_encr(MESHPKTSIZE,buf,meshkey);
|
||||||
|
@ -141,6 +150,7 @@ uint8_t mesh_recvqloop_work(void){
|
||||||
_timet = toff;
|
_timet = toff;
|
||||||
meshincctr++;
|
meshincctr++;
|
||||||
};
|
};
|
||||||
|
meshnice=MO_BODY(meshbuffer[0].pkt)[4];
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ typedef struct {
|
||||||
|
|
||||||
extern char meshgen; // Generation
|
extern char meshgen; // Generation
|
||||||
extern char meshincctr; // Time checker
|
extern char meshincctr; // Time checker
|
||||||
|
extern char meshnice; // Time checker
|
||||||
extern char meshmsg; // Is there something interesting?
|
extern char meshmsg; // Is there something interesting?
|
||||||
extern MPKT meshbuffer[MESHBUFSIZE];
|
extern MPKT meshbuffer[MESHBUFSIZE];
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
#define DEFAULT_SPEED R_RF_SETUP_DR_2M
|
#define DEFAULT_SPEED R_RF_SETUP_DR_2M
|
||||||
|
|
||||||
|
uint8_t _nrfresets=0;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
/* Transmit a byte via SPI */
|
/* Transmit a byte via SPI */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
@ -406,7 +408,6 @@ void nrf_off() {
|
||||||
|
|
||||||
|
|
||||||
void nrf_check_reset(void){
|
void nrf_check_reset(void){
|
||||||
static uint8_t _nrfresets=0;
|
|
||||||
if(nrf_cmd_status(C_NOP) & R_STATUS_MAX_RT){
|
if(nrf_cmd_status(C_NOP) & R_STATUS_MAX_RT){
|
||||||
_nrfresets++;
|
_nrfresets++;
|
||||||
nrf_init();
|
nrf_init();
|
||||||
|
|
|
@ -166,6 +166,7 @@ int nrf_rcv_pkt_poll_dec(int maxsize, uint8_t * pkt, uint32_t const key[4]);
|
||||||
// more utility.
|
// more utility.
|
||||||
void nrf_rcv_pkt_end(void);
|
void nrf_rcv_pkt_end(void);
|
||||||
void nrf_check_reset(void);
|
void nrf_check_reset(void);
|
||||||
|
extern uint8_t _nrfresets;
|
||||||
|
|
||||||
/* END */
|
/* END */
|
||||||
|
|
||||||
|
|
|
@ -86,3 +86,5 @@ input
|
||||||
saveConfig
|
saveConfig
|
||||||
lcdShowAnim
|
lcdShowAnim
|
||||||
lcdLoadImage
|
lcdLoadImage
|
||||||
|
meshnice
|
||||||
|
_nrfresets
|
||||||
|
|
|
@ -27,7 +27,7 @@ CFLAGS+=-mlong-calls -fno-toplevel-reorder
|
||||||
CRYPT=cp
|
CRYPT=cp
|
||||||
CRYPTFLAGS=-p
|
CRYPTFLAGS=-p
|
||||||
|
|
||||||
all: $(OBJS) $(ELFS) $(BINS) $(CODS) $(NIKS) 1boot.int
|
all: $(OBJS) $(ELFS) $(BINS) $(CODS) $(NIKS) 1boot.int debug.int
|
||||||
|
|
||||||
$(LDFILE):
|
$(LDFILE):
|
||||||
-@echo "MEMORY" > $(LDFILE)
|
-@echo "MEMORY" > $(LDFILE)
|
||||||
|
@ -55,6 +55,9 @@ $(LDFILE):
|
||||||
1boot.int: 1boot.c0d .PHONY
|
1boot.int: 1boot.c0d .PHONY
|
||||||
mv $< $@
|
mv $< $@
|
||||||
|
|
||||||
|
debug.int: debug.c0d .PHONY
|
||||||
|
mv $< $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o *.elf *.bin usetable.h
|
rm -f *.o *.elf *.bin usetable.h
|
||||||
|
|
||||||
|
|
|
@ -204,6 +204,9 @@ void m_time(void){
|
||||||
lcdPrint("Inc:");
|
lcdPrint("Inc:");
|
||||||
lcdPrintInt(meshincctr);
|
lcdPrintInt(meshincctr);
|
||||||
lcdNl();
|
lcdNl();
|
||||||
|
lcdPrint("Nice:");
|
||||||
|
lcdPrintInt(meshnice);
|
||||||
|
lcdNl();
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
delayms_queue(50);
|
delayms_queue(50);
|
||||||
}while ((getInputRaw())==BTN_NONE);
|
}while ((getInputRaw())==BTN_NONE);
|
||||||
|
@ -217,7 +220,7 @@ void ChkFunk(){
|
||||||
lcdPrint("cfg:");
|
lcdPrint("cfg:");
|
||||||
lcdPrintln(IntToStrX(nrf_read_reg(R_CONFIG),2));
|
lcdPrintln(IntToStrX(nrf_read_reg(R_CONFIG),2));
|
||||||
lcdPrintln("Resets:");
|
lcdPrintln("Resets:");
|
||||||
lcdPrintln(IntToStr(nrf_check_reset(),3,0));
|
lcdPrintln(IntToStr(_nrfresets,3,0));
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
while(!getInputRaw())work_queue();
|
while(!getInputRaw())work_queue();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue