本文整理汇总了C++中LED_Toggle函数的典型用法代码示例。如果您正苦于以下问题:C++ LED_Toggle函数的具体用法?C++ LED_Toggle怎么用?C++ LED_Toggle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LED_Toggle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ui_usb_sof_event
void ui_usb_sof_event(void)
{
static uint16_t counter_sof = 0;
if (ui_enum_status == UHC_ENUM_SUCCESS) {
/* Display device enumerated and in active mode */
if (++counter_sof > ui_device_speed_blink) {
counter_sof = 0;
LED_Toggle(LED0_GPIO);
}
}
}
示例2: Spark_Save_Firmware_Chunk
int Spark_Save_Firmware_Chunk(FileTransfer::Descriptor& file, const uint8_t* chunk, void* reserved)
{
TimingFlashUpdateTimeout = 0;
int result = -1;
system_notify_event(firmware_update, firmware_update_progress, &file);
if (file.store==FileTransfer::Store::FIRMWARE)
{
result = HAL_FLASH_Update(chunk, file.chunk_address, file.chunk_size, NULL);
LED_Toggle(LED_RGB);
}
return result;
}
示例3: in
/****************************************************************************
Function: LED_InvertBank
Parameters
bank: one of the #define'd LED_BANKx values.
pattern: char, which LEDs to toggle.
Returns
char: SUCCESS or ERROR
Description
Forces the LEDs in (bank) to toggle for each bit that is high in the pattern.
Notes: none.
Author: Gabriel Hugh Elkaim, 2011.12.25 01:16
****************************************************************************/
char LED_InvertBank(unsigned char bank, unsigned char pattern) {
char i;
pattern &= FULLBANK;
if (ledStatus.led_on == FALSE) return ERROR;
if ((bank & LED_BANK1) && (ledStatus.one_on)) {
for (i = 0; i < NUMLEDSPERBANK; i++) {
if (pattern & (1 << i)) LED_Toggle(i);
}
return SUCCESS;
}
return ERROR;
}
示例4: SysTickHandler
void
SysTickHandler(void)
{
g_ulTickCount++;
cofanie++;
if((g_ulTickCount % 100) == 0)
{
LED_Toggle(BOTH_LEDS);
}
PushButtonDebouncer();
BumpSensorDebouncer();
}
示例5: main
int main( void )
{
bsp_gpio_init();
bsp_temp_init();
bsp_serial_init(NULL);
while (1) {
LED_Toggle();
delay_ms(100);
printf("chip temperature : %.2f degC\r\n", TEMP_GetTemperature());
}
}
示例6: ui_usb_sof_event
void ui_usb_sof_event(void)
{
bool b_btn_state;
static bool btn_suspend = false;
static uint16_t counter_sof = 0;
static uint16_t counter_sof_move_refresh = 0;
if (ui_enum_status == UHC_ENUM_SUCCESS) {
/* Display device enumerated and in active mode */
if (++counter_sof > ui_device_speed_blink) {
counter_sof = 0;
if (ui_hid_mouse_plug || ui_msc_plug) {
LED_Toggle(LED0);
} else {
LED_On(LED0);
}
if (ui_test_done && !ui_test_result) {
/* Test fail then blink BL */
backlight_toggle();
}
}
/* Scan button to enter in suspend mode and remote wakeup */
b_btn_state = (!ioport_get_pin_level(GPIO_PUSH_BUTTON_0)) ?
true : false;
if (b_btn_state != btn_suspend) {
/* Button have changed */
btn_suspend = b_btn_state;
if (b_btn_state) {
/* Button has been pressed */
LED_Off(LED0);
backlight_off();
ui_enable_asynchronous_interrupt();
uhc_suspend(true);
return;
}
}
/* Move the remote mouse pointer on the Board Monitor screen */
if (++counter_sof_move_refresh > 100) {
counter_sof_move_refresh = 0;
bm_mouse_pointer_move(bm_x / 8, bm_y / 8);
}
/* Power on a LED when the mouse button down */
if (ui_nb_down) {
LED_On(LED0);
}
}
}
示例7: tc_irq
__interrupt
#endif
static void tc_irq(void)
{
// Increment the ms seconds counter
tc_tick++;
// Clear the interrupt flag. This is a side effect of reading the TC SR.
tc_read_sr(EXAMPLE_TC, EXAMPLE_TC_CHANNEL);
// specify that an interrupt has been raised
update_timer = true;
// Toggle a GPIO pin (this pin is used as a regular GPIO pin).
LED_Toggle(LED0);
}
示例8: FastBlink
void FastBlink()
{
LED_Off(LED0|LED1|LED2|LED3);
unsigned int counter = 0;
while (1)
{
//if (counter % 1)
LED_Toggle(LED0);
if (counter % 2)
LED_Toggle(LED1);
if (counter % 4)
LED_Toggle(LED2);
if (counter % 8)
LED_Toggle(LED3);
counter++;
cpu_delay_ms(2, FOSCRC);
}
}
示例9: main
/**
* \brief Main code entry point.
*/
int main( void )
{
/* Prepare the hardware */
prvSetupHardware();
/* Usi initialization */
usi_init();
/* Initialize USI communication structure */
x_phy_serial_msg.uc_protocol_type = PROTOCOL_USER_DEFINED;
while (1) {
usi_process();
/* blink led 0 */
if (b_led_swap) {
b_led_swap = false;
#if (BOARD == SAM4CMP_DB || BOARD == SAM4CMS_DB)
LED_Toggle(LED4);
#else
LED_Toggle(LED0);
#endif
}
}
}
示例10: assert_failed
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* USER CODE BEGIN 6 */
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
MX_IWDG_Init();
for (;;) {
/* Fast blinking LED */
__HAL_IWDG_RELOAD_COUNTER(&hiwdg);
LED_Toggle();
HAL_Delay(70);
}
/* USER CODE END 6 */
}
示例11: SysTick_Handler
/**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
void SysTick_Handler(void)
{
static uint8_t count_time=0;
OS_TimeMS ++;
count_time++;
if(count_time == 10)
{
GUI_TOUCH_Exec(); //每10ms调用一次,触发调用触摸驱动
count_time =0;
}
LED_Toggle(); //每100ms反转一次led
}
示例12: ui_usb_sof_event
void ui_usb_sof_event(void)
{
static uint16_t counter_sof = 0;
if (ui_enum_status == UHC_ENUM_SUCCESS) {
/* Display device enumerated and in active mode */
if (++counter_sof > ui_device_speed_blink) {
counter_sof = 0;
LED_Toggle(LED_0_PIN);
if (ui_test_done && !ui_test_result) {
/* Test fail */
LED_Off(LED_0_PIN);
}
}
}
}
示例13: I2C_Slave_Wait_Completion
/****************************************************************************************************
* @fn I2C_Slave_Wait_Completion
* This function allows application to pend on completion for slave transfer
*
***************************************************************************************************/
static void I2C_Slave_Wait_Completion( void )
{
OS_RESULT result;
static uint32_t dessimate = 0;
result = os_evt_wait_or( I2C_SLAVE_XFER_DONE, MSEC_TO_TICS(500));
if (result == OS_R_TMO)
{
dessimate++;
if ((dessimate & 0x1) == 0)
{
SensorHubIntLow(); //Deassert Interrupt
//D1_printf("\t### WARNING - Timedout on I2C Slave completion (%d) ###\r\n", dessimate);
LED_Toggle(LED_YELLOW);
}
}
}
示例14: ui_usb_sof_event
void ui_usb_sof_event(void)
{
bool b_btn_state;
static bool btn_suspend = false;
static uint16_t counter_sof = 0;
if (ui_enum_status == UHC_ENUM_SUCCESS) {
/* Display device enumerated and in active mode */
if (++counter_sof > ui_device_speed_blink) {
counter_sof = 0;
if (ui_hid_mouse_plug || ui_msc_plug) {
LED_Toggle(LED0);
} else {
LED_On(LED0);
}
if (ui_test_done) {
if (ui_test_result) {
/* Test successful */
LED_On(LED0);
} else {
/* Test fail */
LED_Off(LED0);
}
}
}
/* Scan button to enter in suspend mode and remote wakeup */
b_btn_state = (!ioport_get_pin_level(GPIO_PUSH_BUTTON_0)) ?
true : false;
if (b_btn_state != btn_suspend) {
/* Button have changed */
btn_suspend = b_btn_state;
if (b_btn_state) {
/* Button has been pressed */
LED_Off(LED0);
ui_enable_asynchronous_interrupt();
uhc_suspend(true);
return;
}
}
/* Power on a LED when the mouse button down */
if (ui_nb_down) {
LED_On(LED0);
}
}
}
示例15: portTASK_FUNCTION
portTASK_FUNCTION(LED_Run_Task, pvParameters)
{
while(1)
{
// while (xSemaphoreTake(DALI_LEDs_Task_Signal, 10) == pdTRUE) // 10ms timeout
// {
// uint8_t i = 10;
// while(i--)
// {
// DALI_LED_Toggle();
// vTaskDelay(20);
// }
// }
LED_Toggle();
vTaskDelay(300);
}
// vTaskDelete(NULL);
}