本文整理汇总了C++中LED_Toggle函数的典型用法代码示例。如果您正苦于以下问题:C++ LED_Toggle函数的具体用法?C++ LED_Toggle怎么用?C++ LED_Toggle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LED_Toggle函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:12,代码来源:ui.c
示例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;
}
开发者ID:elcojacobs,项目名称:brewpi-firmware,代码行数:12,代码来源:system_update.cpp
示例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;
}
开发者ID:mdunne,项目名称:ANIMA,代码行数:29,代码来源:LED.c
示例4: SysTickHandler
void
SysTickHandler(void)
{
g_ulTickCount++;
cofanie++;
if((g_ulTickCount % 100) == 0)
{
LED_Toggle(BOTH_LEDS);
}
PushButtonDebouncer();
BumpSensorDebouncer();
}
开发者ID:Manrul,项目名称:Mikroprocesory,代码行数:13,代码来源:dalsze_zmiany.c
示例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());
}
}
开发者ID:Hom-Wang,项目名称:SmartIMU,代码行数:13,代码来源:main.c
示例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);
}
}
}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:49,代码来源:ui.c
示例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);
}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:15,代码来源:tc_example3.c
示例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);
}
}
开发者ID:gcielniak,项目名称:evk1104,代码行数:24,代码来源:main.c
示例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
}
}
}
开发者ID:thegeek82000,项目名称:asf,代码行数:27,代码来源:usi_user_protocol_template.c
示例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 */
}
开发者ID:olegv142,项目名称:stm32-config,代码行数:22,代码来源:main.c
示例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
}
开发者ID:WildfireTeamPRJ,项目名称:wildfire_stm32_emWin,代码行数:21,代码来源:stm32f10x_it.c
示例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);
}
}
}
}
开发者ID:InSoonPark,项目名称:asf,代码行数:16,代码来源:ui.c
示例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);
}
}
}
开发者ID:hongyunnchen,项目名称:open-sensor-platform,代码行数:22,代码来源:i2c_slavecomm_t.c
示例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);
}
}
}
开发者ID:InSoonPark,项目名称:asf,代码行数:46,代码来源:ui.c
示例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);
}
开发者ID:tqkhcmut,项目名称:FEP_F4,代码行数:18,代码来源:LED_Run_Task.c
示例16: main
int main(void) {
uint32_t t;
uint32_t sindex = 0;
int i;
SystemCoreClockSet(MSI48M_CLOCKSRC,0,2,0);
SysTick_Config(SystemCoreClock/1000);
APBPeripheralClockSet(0,0); /* Enable APBx */
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN; /* Enable SysConfig, Comp, etc. */
t = LED_Init(LED_ALL);
t = LCD_Init();
result = t;
LED_Toggle(LED_GREEN);
LCD_WriteString("hello");
Delay(10000);
LCD_WriteSegments(allsegs);
Delay(10000);
LCD_WriteToRAM(alldispsegs);
Delay(10000);
LCD_Clear();
for (;;) {
for(i=0;i<6;i++) {
segs[i] = sorder[sindex];
}
LCD_WriteSegments(segs);
Delay(2000);
sindex++;
if( sindex >= sizeof(sorder)/sizeof(uint32_t)) sindex = 0;
}
}
开发者ID:hans-jorg,项目名称:stm32l476gdiscovery,代码行数:44,代码来源:main.c
示例17: ui_usb_sof_event
void ui_usb_sof_event(void)
{
bool b_btn_state;
static bool btn_suspend_and_remotewakeup = 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;
LED_Toggle(LED_YELLOW0);
}
/* Scan button to enter in suspend mode and remote wakeup */
/*b_btn_state = (!gpio_pin_is_high(GPIO_PUSH_BUTTON_1)) ?
true : false;*/
b_btn_state = true;
if (b_btn_state != btn_suspend_and_remotewakeup) {
/* Button have changed */
btn_suspend_and_remotewakeup = b_btn_state;
if (b_btn_state) {
/* Button has been pressed */
ui_enable_asynchronous_interrupt();
USBH_suspend(true);
return;
}
}
/* Power on a LED when the mouse move */
if (!ui_x && !ui_y && !ui_scroll) {
#if 2 == LED_NUM
LED_Clear(LED_YELLOW1);
#endif
} else {
ui_x = ui_y = ui_scroll = 0;
#if 2 == LED_NUM
LED_Set(LED_YELLOW1);
#endif
}
}
}
开发者ID:gstroe,项目名称:Arm,代码行数:43,代码来源:ui.c
示例18: toggle_led
/*! \brief Toggle LED
*/
int32_t toggle_led(uint32_t number_of_toggles)
{
volatile uint32_t start_count, end_count;
int32_t result = 0;
start_count = Get_system_register(AVR32_COUNT);
for (uint32_t i = 0; i < number_of_toggles; i++) {
LED_Toggle(LED0);
}
end_count = Get_system_register(AVR32_COUNT);
result = end_count - start_count;
print(EXAMPLE_USART, " - Number of cycles: ");
print_ulong(EXAMPLE_USART, result);
print(EXAMPLE_USART, "\r\n");
return result;
}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:22,代码来源:hmatrix_example.c
示例19: prompt_user
/** \brief User prompt routine
*
* This routine prompts the user to press the button and then waits
* for him to do so.
*/
static void prompt_user(char *prompt_string)
{
/* Output prompt string */
printf("%s\r\n", prompt_string);
/* Wait for user to push button before continuing */
LED_Off(ALL_LEDS);
/* Just blink LED until button is pushed */
while (!SWITCH_PRESSED) {
LED_Toggle(PROMPT_LED);
delay_ms(100);
}
LED_Off(PROMPT_LED);
/* Wait until button is released */
while (SWITCH_PRESSED) {
}
}
开发者ID:marekr,项目名称:asf,代码行数:25,代码来源:main.c
示例20: main
int main(void)
{
serial_init();
printf("Hello world!\n");
printf("Malloc 1024 bytes... ");
int i = 0;
char *data = malloc(1024 * sizeof(char));
printf("[%s]\n", (data == NULL ? "FAIL" : " OK "));
printf("Global var @ %p\n", external);
printf("Local var @ %p\n", &i);
printf("Heap var @ %p\n", data);
while(1) {
printf("Toggle! %d\n", i++);
LED_Toggle(LED0);
delay_ms(500);
}
}
开发者ID:tkuester,项目名称:uc3a3-xplained-templates,代码行数:20,代码来源:main.c
注:本文中的LED_Toggle函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论