Merge branch 'DiSlord_test_branch'

pull/4/head
erikkaashoek 6 years ago
commit e9626c21ff

@ -65,13 +65,13 @@ endif
# Stack size to be allocated to the Cortex-M process stack. This stack is # Stack size to be allocated to the Cortex-M process stack. This stack is
# the stack used by the main() thread. # the stack used by the main() thread.
ifeq ($(USE_PROCESS_STACKSIZE),) ifeq ($(USE_PROCESS_STACKSIZE),)
USE_PROCESS_STACKSIZE = 0x240 USE_PROCESS_STACKSIZE = 0x180
endif endif
# Stack size to the allocated to the Cortex-M main/exceptions stack. This # Stack size to the allocated to the Cortex-M main/exceptions stack. This
# stack is used for processing interrupts and exceptions. # stack is used for processing interrupts and exceptions.
ifeq ($(USE_EXCEPTIONS_STACKSIZE),) ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
USE_EXCEPTIONS_STACKSIZE = 0x200 USE_EXCEPTIONS_STACKSIZE = 0x100
endif endif
# #

@ -529,7 +529,7 @@
/** /**
* ChibiOS/os/various/shell/shell_cmd.c * ChibiOS/os/various/shell/shell_cmd.c
*/ */
#define SHELL_CMD_EXIT_ENABLED TRUE #define SHELL_CMD_EXIT_ENABLED FALSE
#define SHELL_CMD_INFO_ENABLED FALSE #define SHELL_CMD_INFO_ENABLED FALSE
#define SHELL_CMD_ECHO_ENABLED FALSE #define SHELL_CMD_ECHO_ENABLED FALSE
#define SHELL_CMD_SYSTIME_ENABLED FALSE #define SHELL_CMD_SYSTIME_ENABLED FALSE

@ -317,7 +317,7 @@
* buffers. * buffers.
*/ */
#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
#define SERIAL_USB_BUFFERS_SIZE 128 #define SERIAL_USB_BUFFERS_SIZE 32
#endif #endif
/** /**

@ -124,7 +124,7 @@ extern int dirty;
bool completed = false; bool completed = false;
static THD_WORKING_AREA(waThread1, 900); static THD_WORKING_AREA(waThread1, 768);
static THD_FUNCTION(Thread1, arg) static THD_FUNCTION(Thread1, arg)
{ {
(void)arg; (void)arg;

@ -502,7 +502,7 @@ extern volatile uint8_t redraw_request;
#define RGBHEX(hex) ( (((hex)&0x001c00)<<3) | (((hex)&0x0000f8)<<5) | (((hex)&0xf80000)>>16) | (((hex)&0x00e000)>>13) ) #define RGBHEX(hex) ( (((hex)&0x001c00)<<3) | (((hex)&0x0000f8)<<5) | (((hex)&0xf80000)>>16) | (((hex)&0x00e000)>>13) )
// Define size of screen buffer in pixels (one pixel 16bit size) // Define size of screen buffer in pixels (one pixel 16bit size)
#define SPI_BUFFER_SIZE 1024 #define SPI_BUFFER_SIZE (CELLWIDTH*CELLHEIGHT)
#define LCD_WIDTH 320 #define LCD_WIDTH 320
#define LCD_HEIGHT 240 #define LCD_HEIGHT 240

@ -515,12 +515,12 @@ const uint16_t numfont16x22[] = {
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
0b1111001100110000, 0b1110111000011100,
0b1111011111111100, 0b1111111100111110,
0b1111111111111110, 0b1111111111111111,
0b1111111111111110, 0b1111111111111111,
0b1111111111011111, 0b1111001111001111,
0b1111101111001111, 0b1111001111001111,
0b1111001111001111, 0b1111001111001111,
0b1111001111001111, 0b1111001111001111,
0b1111001111001111, 0b1111001111001111,
@ -536,22 +536,22 @@ const uint16_t numfont16x22[] = {
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b1111000000011110,
0b0000000000000000, 0b1111000000011110,
0b1111000000001111, 0b1111000000011110,
0b1111000000001111, 0b1111000000011110,
0b1111000000001111, 0b1111000000011110,
0b1111000000001111, 0b1111000000011110,
0b1111000000001111, 0b1111000000011110,
0b1111000000001111, 0b1111000000011110,
0b1111000000001111, 0b1111100000111110,
0b1111000000001111, 0b1111110001111110,
0b1111000000011111, 0b1111111111111110,
0b1111100000111111, 0b1111111111111111,
0b1111110001111111, 0b1111011111001111,
0b0111111111111111, 0b1111001110000111,
0b0011111111101111, 0b1111000000000000,
0b0001111111001111, 0b1111000000000000,
0b0000000000000000, // n 0b0000000000000000, // n
0b0000000000000000, 0b0000000000000000,

@ -34,7 +34,7 @@ uint32_t maxFreq = 520000000;
uint32_t measured_sweep_time = 0; uint32_t measured_sweep_time = 0;
//int setting.refer = -1; // Off by default //int setting.refer = -1; // Off by default
int const reffer_freq[] = {30000000, 15000000, 10000000, 4000000, 3000000, 2000000, 1000000}; static const int reffer_freq[] = {30000000, 15000000, 10000000, 4000000, 3000000, 2000000, 1000000};
int in_selftest = false; int in_selftest = false;

@ -59,18 +59,6 @@ static void shiftOut(uint8_t val)
{ {
SI4432_log(SI4432_Sel); SI4432_log(SI4432_Sel);
SI4432_log(val); SI4432_log(val);
#if 0
uint8_t i = 0;
do {
if (val & 0x80)
SPI2_SDI_HIGH;
else
SPI2_SDI_LOW;
val<<=1;
SPI2_CLK_HIGH;
SPI2_CLK_LOW;
}while((++i) & 0x07);
#else
uint8_t i = 0; uint8_t i = 0;
do { do {
if (val & 0x80) if (val & 0x80)
@ -79,7 +67,6 @@ static void shiftOut(uint8_t val)
SPI2_RESET; SPI2_RESET;
val<<=1; val<<=1;
}while((++i) & 0x07); }while((++i) & 0x07);
#endif
} }
static uint8_t shiftIn(void) static uint8_t shiftIn(void)
@ -95,21 +82,32 @@ static uint8_t shiftIn(void)
return value>>GPIO_SPI2_SDO; return value>>GPIO_SPI2_SDO;
} }
static void shiftInBuf(uint8_t *buf, uint16_t size, uint16_t delay) { static inline void shiftInBuf(uint16_t sel, uint8_t addr, uint8_t *buf, uint16_t size, uint16_t delay) {
uint8_t i = 0; uint8_t i = 0;
do{ do{
uint8_t value = 0; uint32_t value = addr;
palClearPad(GPIOC, sel);
do { do {
if (value & 0x80)
SPI2_SDI_HIGH;
SPI2_CLK_HIGH; SPI2_CLK_HIGH;
value = (value<<1)|SPI2_SDO; SPI2_RESET;
value<<=1;
}while((++i) & 0x07);
value = 0;
do {
SPI2_CLK_HIGH;
value<<=1;
value|=SPI2_portSDO;
SPI2_CLK_LOW; SPI2_CLK_LOW;
}while((++i) & 0x07); }while((++i) & 0x07);
*buf++=value; palSetPad(GPIOC, sel);
*buf++=value>>GPIO_SPI2_SDO;
if (delay) if (delay)
my_microsecond_delay(delay); my_microsecond_delay(delay);
}while(--size); }while(--size);
} }
#if 0
static void shiftOutBuf(uint8_t *buf, uint16_t size) { static void shiftOutBuf(uint8_t *buf, uint16_t size) {
uint8_t i = 0; uint8_t i = 0;
do{ do{
@ -125,7 +123,7 @@ static void shiftOutBuf(uint8_t *buf, uint16_t size) {
}while((++i) & 0x07); }while((++i) & 0x07);
}while(--size); }while(--size);
} }
#endif
const int SI_nSEL[3] = { GPIO_RX_SEL, GPIO_LO_SEL, 0}; // #3 is dummy!!!!!! const int SI_nSEL[3] = { GPIO_RX_SEL, GPIO_LO_SEL, 0}; // #3 is dummy!!!!!!
volatile int SI4432_Sel = 0; // currently selected SI4432 volatile int SI4432_Sel = 0; // currently selected SI4432
@ -413,6 +411,7 @@ void SI4432_Fill(int s, int start)
#endif #endif
uint32_t t = setting.additional_step_delay_us; uint32_t t = setting.additional_step_delay_us;
START_PROFILE; START_PROFILE;
#if 1
SPI2_CLK_LOW; SPI2_CLK_LOW;
int i = start; int i = start;
do { do {
@ -424,6 +423,10 @@ void SI4432_Fill(int s, int start)
if (t) if (t)
my_microsecond_delay(t); my_microsecond_delay(t);
} while(1); } while(1);
#else
shiftInBuf(sel, SI4432_REG_RSSI, (uint8_t *)&age[start], sweep_points - start, t);
#endif
// STOP_PROFILE;
setting.actual_sweep_time_us = DELTA_TIME*100; setting.actual_sweep_time_us = DELTA_TIME*100;
buf_index = start; // Is used to skip 1st entry during level triggering buf_index = start; // Is used to skip 1st entry during level triggering
buf_read = true; buf_read = true;

Loading…
Cancel
Save

Powered by TurnKey Linux.