void SPI_Initialize() { Queue_Initialize(operationQueue, sizeof(operation), SPI_OPERATION_QUEUE_SIZE); //power_spi_enable(); PORTB |= (1 << 2) | (1 << 1); uint8_t dummy = SPSR; // make sure interrupt flag is cleared dummy = SPDR; }
void TD_Initialize(TD * td, int id, QueuePriority priority, int parent_id, void * sp, void * lr) { td->id = id; td->state = READY; td->priority = priority; td->parent_id = parent_id; td->stack_pointer = sp; td->link_register = lr; td->spsr_register = 16; /* This will turn on user mode. */ td->return_value = 0; td->origin_tid = 0; td->receive_msg = 0; td->reply_msg = 0; Queue_Initialize(&td->messages); }
void TD_Initialize(TD * td, int id, QueuePriority priority, int parent_id, void * sp, void * lr) { td->id = id; td->state = READY; td->priority = priority; td->parent_id = parent_id; td->stack_pointer = sp; td->link_register = lr; td->spsr_register = 16 + (TIMER_INTERRUPTS_ENABLED ? 0 : 0x80); /* This will turn on user mode and enable/disable timer interrupts. */ td->return_value = 0; td->origin_tid = 0; td->receive_msg = 0; td->reply_msg = 0; Queue_Initialize(&td->messages); td->event_id = NULL_EVENT; }
void RPSServer_Initialize(RPSServer * server) { server->tid = MyTid(); Queue_Initialize(&server->player_tid_queue); server->player_1_tid = 0; server->player_2_tid = 0; server->is_playing_game = 0; server->player_1_choice = NO_CHOICE; server->player_2_choice = NO_CHOICE; server->running = 1; server->games_played = 0; server->is_shutdown = 0; int i; for (i = 0; i < MAX_TASKS + 1; i++) { server->signed_in_players[i] = 0; } }
void RddProtocol_Initialize() { Queue_Initialize(transportRddQueue, sizeof(queue_element), NETWORK_TRANSPORT_RDD_QUEUE_SIZE); }