mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
Updated USB descriptor to use the BCD values stated on the wiki page http://wiki.openpilot.org/display/Doc/Firmware+USB+descriptors
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2993 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
88b2d360a3
commit
b71bc49ce3
@ -33,7 +33,7 @@
|
||||
|
||||
// firmware version
|
||||
#define VERSION_MAJOR 0 // 0 to 255
|
||||
#define VERSION_MINOR 8 // 0 to 255
|
||||
#define VERSION_MINOR 9 // 0 to 255
|
||||
|
||||
// macro's for reading internal flash memory
|
||||
#define mem8(addr) (*((volatile uint8_t *)(addr)))
|
||||
|
@ -49,7 +49,8 @@
|
||||
//#define PIOS_USB_PRODUCT_ID 0x415C // PipXtreme PID
|
||||
|
||||
#ifndef PIOS_USB_VERSION_ID
|
||||
#define PIOS_USB_VERSION_ID 0x1201 /* v2.00 */
|
||||
//#define PIOS_USB_VERSION_ID 0x1201 /* v2.00 */
|
||||
#define PIOS_USB_VERSION_ID 0x0301 // PipXtreme, board revision 1
|
||||
#endif
|
||||
|
||||
/* Internal defines which are used by PIOS USB HID (don't touch) */
|
||||
|
@ -263,6 +263,20 @@ void ppm_In_Supervisor(void)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t ppm_In_NewFrame(void)
|
||||
{
|
||||
if (booting || ppm_initialising)
|
||||
return 0;
|
||||
|
||||
if (ppm_In_Frames >= 4 && ppm_In_Frames != ppm_In_PrevFrames)
|
||||
{ // we have a new PPM frame
|
||||
ppm_In_PrevFrames = ppm_In_Frames;
|
||||
return ppm_In_PrevFrames;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t ppm_In_GetChannelPulseWidth(uint8_t channel)
|
||||
{
|
||||
if (booting || ppm_initialising)
|
||||
@ -329,10 +343,8 @@ void ppm_process(void)
|
||||
|
||||
if (saved_settings.mode == MODE_PPM_TX)
|
||||
{
|
||||
if (ppm_In_Frames > 0 && ppm_In_Frames != ppm_In_PrevFrames)
|
||||
{ // we have a new PPM frame
|
||||
|
||||
ppm_In_PrevFrames = ppm_In_Frames;
|
||||
if (ppm_In_NewFrame() > 0)
|
||||
{ // we have a new PPM frame to send
|
||||
|
||||
#ifdef PPM_DEBUG
|
||||
DEBUG_PRINTF("\r\n");
|
||||
@ -344,7 +356,7 @@ void ppm_process(void)
|
||||
// int32_t pwm = ppm_In_GetChannelPulseWidth(i);
|
||||
|
||||
#ifdef PPM_DEBUG
|
||||
DEBUG_PRINTF("ppm_in: %u %u %4u\r\n", ppm_In_PrevFrames, i, ppm_In_GetChannelPulseWidth(i));
|
||||
DEBUG_PRINTF("ppm_in: %u %u %4u\r\n", ppm_In_Frames, i, ppm_In_GetChannelPulseWidth(i));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -364,6 +376,10 @@ void ppm_deinit(void)
|
||||
// disable the PPM timer
|
||||
TIM_Cmd(PIOS_PPM_IN_TIM, DISABLE);
|
||||
|
||||
// un-remap the PPM IN pin
|
||||
// GPIO_PinRemapConfig(GPIO_PartialRemap1_TIM2, DISABLE);
|
||||
GPIO_PinRemapConfig(GPIO_PartialRemap2_TIM2, DISABLE);
|
||||
// GPIO_PinRemapConfig(GPIO_FullRemap_TIM2, DISABLE);
|
||||
}
|
||||
|
||||
void ppm_init(uint32_t our_sn)
|
||||
|
Loading…
x
Reference in New Issue
Block a user