Correct typos and add SI4432 timing debug function

Removed_REF_marker
erikkaashoek 5 years ago
parent 31545e3b17
commit 62e5b6ae43

@ -12,9 +12,9 @@ TARGET=F303
# Compiler options here. # Compiler options here.
ifeq ($(USE_OPT),) ifeq ($(USE_OPT),)
ifeq ($(TARGET),F303) ifeq ($(TARGET),F303)
USE_OPT = -O2 -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -std=c11 USE_OPT = -Og -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -std=c11
else else
USE_OPT = -O2 -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -std=c11 USE_OPT = -Og -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -std=c11
endif endif
endif endif

@ -270,7 +270,7 @@
PIN_OTYPE_PUSHPULL(GPIOB_I2S2_MOSI)) PIN_OTYPE_PUSHPULL(GPIOB_I2S2_MOSI))
#define VAL_GPIOB_OSPEEDR (PIN_PUPDR_FLOATING(GPIOB_XN) | \ #define VAL_GPIOB_OSPEEDR (PIN_PUPDR_FLOATING(GPIOB_XN) | \
PIN_PUPDR_FLOATING(GPIOB_YN) | \ PIN_PUPDR_FLOATING(GPIOB_YN) | \
PIN_OSPEED_100M(GPIOB_RX_SEL) | \ PIN_OSPEED_2M(GPIOB_RX_SEL) | \
PIN_OSPEED_100M(3) | \ PIN_OSPEED_100M(3) | \
PIN_OSPEED_100M(4) | \ PIN_OSPEED_100M(4) | \
PIN_OSPEED_100M(5) | \ PIN_OSPEED_100M(5) | \
@ -278,7 +278,7 @@
PIN_OSPEED_100M(7) | \ PIN_OSPEED_100M(7) | \
PIN_OSPEED_100M(GPIOB_I2C1_SCL) | \ PIN_OSPEED_100M(GPIOB_I2C1_SCL) | \
PIN_OSPEED_100M(GPIOB_I2C1_SDA) | \ PIN_OSPEED_100M(GPIOB_I2C1_SDA) | \
PIN_OSPEED_100M(GPIOB_LO_SEL) | \ PIN_OSPEED_2M(GPIOB_LO_SEL) | \
PIN_OSPEED_100M(11) | \ PIN_OSPEED_100M(11) | \
PIN_OSPEED_100M(GPIOB_I2S2_WCLK) | \ PIN_OSPEED_100M(GPIOB_I2S2_WCLK) | \
PIN_OSPEED_100M(GPIOB_I2S2_BCLK) | \ PIN_OSPEED_100M(GPIOB_I2S2_BCLK) | \

@ -1,6 +1,5 @@
/* /*
* *
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option) * the Free Software Foundation; either version 3, or (at your option)
* any later version. * any later version.
@ -124,7 +123,7 @@ extern int dirty;
bool completed = false; bool completed = false;
static THD_WORKING_AREA(waThread1, 1024); static THD_WORKING_AREA(waThread1, 1124);
static THD_FUNCTION(Thread1, arg) static THD_FUNCTION(Thread1, arg)
{ {
(void)arg; (void)arg;
@ -2352,7 +2351,8 @@ static const VNAShellCommand commands[] =
#ifdef ENABLE_THREADS_COMMAND #ifdef ENABLE_THREADS_COMMAND
{"threads" , cmd_threads , 0}, {"threads" , cmd_threads , 0},
#endif #endif
{ "y", cmd_y, 0 }, { "y", cmd_y, CMD_WAIT_MUTEX },
{ "z", cmd_z, CMD_WAIT_MUTEX },
{ "i", cmd_i, 0 }, { "i", cmd_i, 0 },
{ "v", cmd_v, 0 }, { "v", cmd_v, 0 },
{ "a", cmd_a, 0 }, { "a", cmd_a, 0 },

@ -301,6 +301,31 @@ VNA_SHELL_FUNCTION(cmd_y)
} }
} }
VNA_SHELL_FUNCTION(cmd_z)
{
static const char cmd_z_list[] = "t|r|i";
if (argc != 1) {
shell_printf("usage: z %s\r\n", cmd_z_list);
return;
}
if (argc == 1) {
SI4432_Sel = VFO;
int type = get_str_index(argv[0], cmd_z_list);
switch(type) {
case 0:
SI4432_Transmit(3);
break;
case 1:
SI4432_Receive();
break;
case 2:
SI4432_Reset();
break;
}
}
}
VNA_SHELL_FUNCTION(cmd_selftest) VNA_SHELL_FUNCTION(cmd_selftest)
{ {
if (argc < 1 || argc > 2) { if (argc < 1 || argc > 2) {

@ -42,7 +42,8 @@
// Hardware or software SPI use // Hardware or software SPI use
#ifdef USE_HARDWARE_SPI_MODE #ifdef USE_HARDWARE_SPI_MODE
#define SI4432_SPI SPI1 #define SI4432_SPI SPI1
#define SI4432_SPI_SPEED SPI_BR_DIV8 //#define SI4432_SPI_SPEED SPI_BR_DIV8
#define SI4432_SPI_SPEED SPI_BR_DIV64
static uint32_t old_spi_settings; static uint32_t old_spi_settings;
#else #else
static uint32_t old_port_moder; static uint32_t old_port_moder;
@ -88,8 +89,8 @@ void start_SI4432_SPI_mode(void){
new_port_moder|= PIN_MODE_OUTPUT(GPIOB_SPI_SCLK)|PIN_MODE_INPUT(GPIOB_SPI_MISO)|PIN_MODE_OUTPUT(GPIOB_SPI_MOSI); new_port_moder|= PIN_MODE_OUTPUT(GPIOB_SPI_SCLK)|PIN_MODE_INPUT(GPIOB_SPI_MISO)|PIN_MODE_OUTPUT(GPIOB_SPI_MOSI);
GPIOB->MODER = new_port_moder; GPIOB->MODER = new_port_moder;
// Pull down SPI // Pull down SPI
SPI_SDI_LOW; SPI1_SDI_LOW;
SPI_CLK_LOW; SPI1_CLK_LOW;
#endif #endif
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.