39 #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1)
68 uint32_t
LedPWM(uint32_t pwm_period, uint32_t pwm_sweep_steps, uint32_t
count);
98 uint32_t stopwatch = 0;
103 prev_ticks += elapsed_ticks;
104 stopwatch += elapsed_ticks;
158 if (stopwatch > 50 * 1000 * 1000)
172 if (((*(__IO uint32_t*) bdinfo->
fw_base) & 0x2FFE0000) == 0x20000000) {
174 RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
175 RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
176 RCC_APB2PeriphResetCmd(0xffffffff, DISABLE);
177 RCC_APB1PeriphResetCmd(0xffffffff, DISABLE);
183 __set_MSP(*(__IO uint32_t*) bdinfo->
fw_base);
190 uint32_t
LedPWM(uint32_t pwm_period, uint32_t pwm_sweep_steps, uint32_t
count) {
191 uint32_t curr_step = (count / pwm_period) % pwm_sweep_steps;
192 uint32_t pwm_duty = pwm_period * curr_step / pwm_sweep_steps;
194 uint32_t curr_sweep = (count / (pwm_period * pwm_sweep_steps));
195 if (curr_sweep & 1) {
196 pwm_duty = pwm_period - pwm_duty;
198 return ((count % pwm_period) > pwm_duty) ? 1 : 0;
uint32_t PIOS_IAP_CheckRequest(void)
Determines if an In-Application-Programming request has been made.
uint16_t PIOS_COM_MSG_Receive(uintptr_t com_id, uint8_t *buf, uint16_t buf_len)
uint32_t PIOS_DELAY_GetuS()
Query the Delay timer for the current uS.
Main PiOS header to include all the compiled in PiOS options.
void processComand(uint8_t *xReceive_Buffer)
uint32_t PIOS_DELAY_GetuSSince(uint32_t t)
Calculate time in microseconds since a previous time.
#define PIOS_COM_TELEM_USB
void PIOS_ANNUNC_Off(uint32_t annunc_id)
const struct pios_board_info pios_board_info_blob
uint32_t LedPWM(uint32_t pwm_period, uint32_t pwm_sweep_steps, uint32_t count)
void PIOS_Board_Init(void)
void PIOS_IAP_Init(void)
PIOS_IAP_Init - performs required initializations for iap module.
uint32_t period1
LEDs PWM.
void PIOS_ANNUNC_On(uint32_t annunc_id)
COM MSG layer functions header.
This file contains the DFU commands handling code.
pFunction Jump_To_Application
void PIOS_IAP_ClearRequest(void)
uint32_t PIOS_Boot_CheckRequest(void)
Determines if a boot request has been made.
static uint8_t mReceive_Buffer[63]
bool PIOS_USB_CableConnected(uintptr_t id)
int32_t PIOS_DELAY_WaitmS(uint32_t mS)
In application programming functions.
#define PIOS_LED_HEARTBEAT
void DataDownload(DownloadAction action)