/* Main function, the entry point of this program. * The main function is called from the startup code in file * Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/TrueSTUDIO/ * startup_stm32f40_41xxx.s (line 107) */ int main(void) { int8_t dir; /* Setup input / output for User Button and LEDs. */ setup_leds(); setup_button(); /* Setup timer to time. */ setup_timer(); /* Setup PWM. */ setup_pwm_timer(); setup_pwm(); while (1) { /* Check delay time. */ delay(); /* Get the lighting direction. */ dir = get_leds_direction(); /* Light LEDs in order. */ pwm_leds(dir); } return 0; // never returns actually }
int main(void) { setup_main_clock(); setup_peripheral_clocks(); setup_usb_fullspeed(); setup_leds(); while (1) usbd_poll(); }
static void __attribute__((naked)) __attribute__((used)) main(void) { setup_leds(); while (1) { switch_leds_on(); delay(); switch_leds_off(); delay(); } }
/* The main function is called from startup_stm32f407xx.s */ int main(void) { HAL_Init(); setup_leds(); while (1) { led_round(); flash_all_leds(); } return 0; }
/* static void poll_ana7(void) { ioport_set_pin_mode(PIN_TC0_TIOA1,IOPORT_MODE_MUX_BIT0); ioport_set_pin_dir(PIN_TC0_TIOA1,IOPORT_DIR_INPUT); while(1) { bool b = ioport_get_pin_level(PIN_TC0_TIOA1); ioport_set_pin_level(LED0_GPIO,b); } } */ int main(void) { sysclk_init(); board_init(); //poll_ana7(); //configure_tc(); setup_capture(); setup_leds(); while (1) { delay_ms(1000); } }
int main( void ) { uint8_t buffer_index; packet_header_t* header; // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; header = (packet_header_t*)tx_buffer; // Initialize Tx Buffer header->length = sizeof(packet_header_t) - 1; header->source = DEVICE_ADDRESS; header->type = 0x66; // Sync message header->flags = 0xAA; // Make sure processor is running at 12MHz setup_oscillator(); // Initialize UART for communications at 115200baud setup_uart(); // Initialize LEDs setup_leds(); // Initialize timer set_ccr( 0, TIMER_LIMIT ); setup_timer_a(MODE_UP); // Send sync message register_timer_callback( send_sync_message, 0 ); // Initialize radio and enable receive callback function setup_radio( process_rx ); // Enable interrupts, otherwise nothing will work eint(); while (1) { // Enter sleep mode __bis_SR_register( LPM0_bits + GIE ); __no_operation(); } return 0; }
void matrix_init(void) { // To use PORTF disable JTAG with writing JTD bit twice within four cycles. MCUCR |= (1<<JTD); MCUCR |= (1<<JTD); // initialize row and col setup_io_pins(); setup_leds(); // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { matrix0[i] = 0; matrix1[i] = 0; } matrix = matrix0; matrix_debounced = matrix1; }
void matrix_init(void) { // To use PORTF disable JTAG with writing JTD bit twice within four cycles. //MCUCR |= (1<<JTD); //MCUCR |= (1<<JTD); // initialize row and col unselect_cols(); init_rows(); #ifndef SLEEP_LED_ENABLE setup_leds(); #endif // initialize matrix state: all keys off for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = 0; matrix_debouncing[i] = 0; } }
extern "C" void setup() { NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 ); setup_unused_pins(); setup_analog_inputs() ; // setup_test_pin(); setup_leds(); video_setup(); #if (QUAN_OSD_BOARD_TYPE != 1 ) Dac_setup(); #endif fsk::setup(); #if QUAN_OSD_BOARD_TYPE == 4 mavlink_tx_rx_task::setup<57600>(interrupt_priority::telemetry_input_port); #else posdata_tx_rx_task::setup<57600>(interrupt_priority::telemetry_input_port); #endif // todo set sign frsky_tx_rx_task::setup<9600>(interrupt_priority::frsky_serial_port); }
// ну и сама функция main c переменной (void) int main(void){ setup_leds(); // берём данные из функции void setup_leds(void) while (1) { // открываем цикл if (GPIOA->IDR & GPIO_IDR_IDR_0) // если выполняется условие { //LED_PORT->ODR = LED_ORANGE | LED_RED; // (если да то выполняется условие) если кнопка нажата то горят (по часовой) //LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; //delay_cycles(500000UL); // LED_PORTD->ODR = Px13; LED_PORTD->ODR = Px0; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); // stars off LED_PORTD->ODR = Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); switch_leds_off(); // Выключем PORTE LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px15; delay_cycles(500000UL); switch_leds_off(); } else if (GPIOA->IDR & GPIO_IDR_IDR_1) // (если да то выполняется условие) если кнопка нажата то горят (против часовой) { LED_PORTE->ODR = Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; // stars off delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3 | Px4; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2 | Px3; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1 | Px2; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0 | Px1; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; LED_PORTE->ODR = Px0; delay_cycles(500000UL); switch_leds_off(); //ввыключаем PORTE LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14 | Px15; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13 | Px14; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12 | Px13; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11 | Px12; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10 | Px11; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9 | Px10; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8 | Px9; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7 | Px8; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6 | Px7; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5 | Px6; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4 | Px5; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3 | Px4; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2 | Px3; delay_cycles(500000UL); LED_PORTD->ODR = Px0 | Px1 | Px2; delay_cycles(500000UL); LED_PORTD->ODR = Px0; delay_cycles(500000UL); switch_leds_off(); } else { // тогда switch_leds_off(); // берём данные из функции void switch_leds_off(void) //LED_PORT->ODR = LED_BLUE; //LED_PORT->ODR = LED_BLUE | LED_GREEN; // (если нет то выполняется условие) если кнопка отжата то горят } } }