Disabling device using button

aprs_test
Łukasz Nidecki 2017-01-22 16:50:09 +01:00
rodzic f4cc03ee86
commit 9d41fe830e
3 zmienionych plików z 19 dodań i 7 usunięć

Wyświetl plik

@ -15,6 +15,7 @@
#define APRS_FREQUENCY 432.500f //Mhz middle frequency
//************rtty speed****************** si4032
#define RTTY_SPEED 300
// SHITY -> 450Hz
//************rtty bits****************** si4032
#define RTTY_7BIT 1
//************rtty stop bits****************** si4032
@ -23,7 +24,8 @@
#define Smoc 7 // PWR 0...7 0- MIN ... 7 - MAX
// 7 -> 42.95 mW@434.150 MHz na E4406A
//***************************************************
// WARNING: do not use this in flying tracker!
#define ALLOW_DISABLE_BY_BUTTON 1
//********** frame delay in msec**********
#define tx_delay 5000

14
main.c
Wyświetl plik

@ -46,6 +46,7 @@ volatile unsigned int tx_on_delay;
volatile unsigned char tx_enable = 0;
rttyStates send_rtty_status = rttyZero;
volatile char *rtty_buf;
volatile uint16_t button_pressed = 0;
unsigned char cun_off = 0;
void send_rtty_packet();
@ -104,6 +105,16 @@ void TIM2_IRQHandler(void) {
}
cun = 200;
}
if (ALLOW_DISABLE_BY_BUTTON){
if (ADCVal[1] > 1900){
button_pressed++;
if (button_pressed > (10 * RTTY_SPEED)){
GPIO_SetBits(GPIOA, GPIO_Pin_12);
}
} else {
button_pressed = 0;
}
}
}
}
@ -149,8 +160,7 @@ int main(void) {
rtty_buf = buf_rtty;
tx_on = 0;
tx_enable = 1;
//tx_enable =0;
//Button = ADCVal[1];
aprs_init();
radio_enable_tx();

Wyświetl plik

@ -86,8 +86,8 @@
<File name="cmsis_boot" path="" type="2"/>
<File name="delay.h" path="delay.h" type="1"/>
<File name="init.h" path="init.h" type="1"/>
<File name="stm_lib/src/stm32f10x_tim.c" path="stm_lib/src/stm32f10x_tim.c" type="1"/>
<File name="stm_lib/inc/stm32f10x_pwr.h" path="stm_lib/inc/stm32f10x_pwr.h" type="1"/>
<File name="stm_lib/src/stm32f10x_tim.c" path="stm_lib/src/stm32f10x_tim.c" type="1"/>
<File name="cmsis_boot/startup" path="" type="2"/>
<File name="cmsis/core_cmFunc.h" path="cmsis/core_cmFunc.h" type="1"/>
<File name="stm_lib/src/misc.c" path="stm_lib/src/misc.c" type="1"/>
@ -100,8 +100,8 @@
<File name="syscalls/syscalls.c" path="syscalls/syscalls.c" type="1"/>
<File name="stm_lib/inc/stm32f10x_spi.h" path="stm_lib/inc/stm32f10x_spi.h" type="1"/>
<File name="init.c" path="init.c" type="1"/>
<File name="stm_lib/inc/stm32f10x_dma.h" path="stm_lib/inc/stm32f10x_dma.h" type="1"/>
<File name="stm_lib/src/stm32f10x_adc.c" path="stm_lib/src/stm32f10x_adc.c" type="1"/>
<File name="stm_lib/inc/stm32f10x_dma.h" path="stm_lib/inc/stm32f10x_dma.h" type="1"/>
<File name="radio.c" path="radio.c" type="1"/>
<File name="ublox.h" path="ublox.h" type="1"/>
<File name="stm_lib/src/stm32f10x_usart.c" path="stm_lib/src/stm32f10x_usart.c" type="1"/>
@ -113,14 +113,14 @@
<File name="cmsis_boot/system_stm32f10x.c" path="cmsis_boot/system_stm32f10x.c" type="1"/>
<File name="stm_lib/inc/misc.h" path="stm_lib/inc/misc.h" type="1"/>
<File name="cmsis/core_cmInstr.h" path="cmsis/core_cmInstr.h" type="1"/>
<File name="QAPRSCommon.h" path="QAPRSCommon.h" type="1"/>
<File name="cmsis/core_cm3.h" path="cmsis/core_cm3.h" type="1"/>
<File name="QAPRSCommon.h" path="QAPRSCommon.h" type="1"/>
<File name="stm_lib/src/stm32f10x_rcc.c" path="stm_lib/src/stm32f10x_rcc.c" type="1"/>
<File name="fun.c" path="fun.c" type="1"/>
<File name="aprs.cpp" path="aprs.cpp" type="1"/>
<File name="radio.h" path="radio.h" type="1"/>
<File name="f_rtty.h" path="f_rtty.h" type="1"/>
<File name="stm_lib/src/stm32f10x_dma.c" path="stm_lib/src/stm32f10x_dma.c" type="1"/>
<File name="f_rtty.h" path="f_rtty.h" type="1"/>
<File name="stm_lib/src" path="" type="2"/>
<File name="cmsis" path="" type="2"/>
<File name="stm_lib" path="" type="2"/>