int main() { init_board(); LED_TRIS = 0; blink(100000L, 10, 0); init_timer(512); init_PWM(); init_ADC(6); init_spi_slave(); spi_slave_set_handle_message(link_board_handle_message); TRISFbits.TRISF5 = 0; while(1) { blink(10000L, 1, 1); } }
//------------------------------- // main function int main(void) { //u32 del; // turn on execution counter // default .crt does this for us // __asm__ __volatile__("R0 = 0x32; SYSCFG = R0; CSYNC;":::"R0"); // initialize clocks and power init_clocks(); // configure programmable flags init_flags(); READY_LO; // intialize the sdram controller init_EBIU(); // intialize the flash controller (which, weirdly, handles gpio) // init_flash(); /// initialize the CV dac (reset) init_cv(); // intialize the sport0 for audio rx/tx init_sport0(); // intialize the sport1 for cv out init_sport1(); // intialize DMA for audio init_DMA(); // // put the spi back in slave mode to receive param changes from avr32 init_spi_slave(); // intialize the audio processing unit (assign memory) module_init(); // assign interrupts init_interrupts(); // begin audio transfers enable_DMA_sport0(); // begin cv transfers enable_DMA_sport1(); // initialize the codec init_1939(); // leds on LED3_HI; LED4_HI; // signal the ready flag READY_HI; while(1) { // fixme: everything happens in ISRs! // ;; /* //// TODO / FIXME: update a param change FIFO here? for now, the answer is no: instead, we are asking avr32 to hold off sending params for as long as the ready-pin is deasserted by frame or control change processing. */ /// while frame processing // ctl_next_frame(); // ctl_perform_last_change(); } }