mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-09 20:45:41 +08:00
add remote for stm32_netradio
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@362 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
1 parent
fa68c661fe
commit
ef88a2f5c9
5 files changed
+212
-190
No files matched your search
+15
-2
@@ -17,6 +17,12 @@ key_left PC3
|
||||
#define key_right_GETVALUE() GPIO_ReadInputDataBit(GPIOG,GPIO_Pin_14)
|
||||
#define key_left_GETVALUE() GPIO_ReadInputDataBit(GPIOG,GPIO_Pin_13)
|
||||
|
||||
/* from remote.c */
|
||||
extern void rem_start(void);
|
||||
extern void rem_encoder(struct rtgui_event_kbd * p);
|
||||
extern unsigned int rem_mode;
|
||||
/* from remote.c */
|
||||
|
||||
static void key_thread_entry(void *parameter)
|
||||
{
|
||||
rt_time_t next_delay;
|
||||
@@ -40,6 +46,8 @@ static void key_thread_entry(void *parameter)
|
||||
GPIO_Init(GPIOE,&GPIO_InitStructure);
|
||||
GPIO_SetBits(GPIOE,GPIO_Pin_2);
|
||||
|
||||
rem_start();
|
||||
|
||||
/* init keyboard event */
|
||||
RTGUI_EVENT_KBD_INIT(&kbd_event);
|
||||
kbd_event.mod = RTGUI_KMOD_NONE;
|
||||
@@ -49,8 +57,13 @@ static void key_thread_entry(void *parameter)
|
||||
{
|
||||
next_delay = 10;
|
||||
kbd_event.key = RTGUIK_UNKNOWN;
|
||||
|
||||
kbd_event.type = RTGUI_KEYDOWN;
|
||||
|
||||
if( rem_mode== 2 )
|
||||
{
|
||||
rem_encoder(&kbd_event);
|
||||
}
|
||||
|
||||
if ( key_enter_GETVALUE() == 0 )
|
||||
{
|
||||
rt_thread_delay( next_delay*4 );
|
||||
@@ -110,7 +123,7 @@ static void key_thread_entry(void *parameter)
|
||||
}
|
||||
}
|
||||
|
||||
void rt_hw_key_init()
|
||||
void rt_hw_key_init(void)
|
||||
{
|
||||
rt_thread_t key_tid;
|
||||
key_tid = rt_thread_create("key",
|
||||
|
||||
+182
-181
File diff suppressed because it is too large.
Load diff
@@ -46,6 +46,7 @@ File 1,1,<.\play_list.c><play_list.c>
|
||||
File 1,1,<.\ili9325\ili9320.c><ili9320.c>
|
||||
File 1,1,<.\codec.c><codec.c>
|
||||
File 1,1,<.\spi_flash.c><spi_flash.c>
|
||||
File 1,1,<.\remote.c><remote.c>
|
||||
File 2,1,<..\..\src\clock.c><clock.c>
|
||||
File 2,1,<..\..\src\idle.c><idle.c>
|
||||
File 2,1,<..\..\src\ipc.c><ipc.c>
|
||||
@@ -307,8 +308,8 @@ Options 1,0,0 // Target 'RT-Thread STM32 Radio'
|
||||
ADSLDIF ()
|
||||
ADSLDDW ()
|
||||
OPTDL (SARMCM3.DLL)()(DARMSTM.DLL)(-pSTM32F103ZE)(SARMCM3.DLL)()(TARMSTM.DLL)(-pSTM32F103ZE)
|
||||
OPTDBG 48118,7,()()()()()()()()()() (Segger\JL2CM3.dll)()()()
|
||||
FLASH1 { 1,0,0,0,1,0,0,0,5,16,0,0,0,0,0,0,0,0,0,0 }
|
||||
OPTDBG 49142,7,()()()()()()()()()() (Segger\JL2CM3.dll)()()()
|
||||
FLASH1 { 1,0,0,0,1,0,0,0,6,16,0,0,0,0,0,0,0,0,0,0 }
|
||||
FLASH2 (Segger\JL2CM3.dll)
|
||||
FLASH3 ("" ())
|
||||
FLASH4 ()
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "stm32f10x_rtc.h"
|
||||
#include "stm32f10x_sdio.h"
|
||||
#include "stm32f10x_spi.h"
|
||||
/* #include "stm32f10x_tim.h" */
|
||||
#include "stm32f10x_tim.h"
|
||||
#include "stm32f10x_usart.h"
|
||||
/* #include "stm32f10x_wwdg.h" */
|
||||
#include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
|
||||
@@ -64,11 +64,11 @@
|
||||
* If expr is true, it returns no value.
|
||||
* @retval None
|
||||
*/
|
||||
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void assert_failed(uint8_t* file, uint32_t line);
|
||||
void assert_failed(uint8_t* file, uint32_t line);
|
||||
#else
|
||||
#define assert_param(expr) ((void)0)
|
||||
#define assert_param(expr) ((void)0)
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
|
||||
#endif /* __STM32F10x_CONF_H */
|
||||
|
||||
@@ -700,7 +700,7 @@ void DMA2_Channel2_IRQHandler(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* add on 2009-12-31 usb */
|
||||
/* add on 2009-12-31 for usb */
|
||||
extern void CTR_HP(void);
|
||||
extern void USB_Istr(void);
|
||||
void USB_HP_CAN1_TX_IRQHandler(void)
|
||||
@@ -712,3 +712,10 @@ void USB_LP_CAN1_RX0_IRQHandler(void)
|
||||
{
|
||||
USB_Istr();
|
||||
}
|
||||
|
||||
/* add on 2010-01-02 for remote */
|
||||
extern void remote_isr(void);
|
||||
void TIM5_IRQHandler(void)
|
||||
{
|
||||
remote_isr();
|
||||
}
|
||||
Reference in new issue
Block a user