void WriteMMC(uint16_t addr, uint8_t data) { //debuglog("PC=%04X WriteMMC(%04X,%02X)\n",pc,addr,data); WASWRITE=1; LatchedAtomAddr=(addr & 0x0F); Atom_to_MMC=data; at_process(); }
uint8_t ReadMMC(uint16_t addr) { BYTE Current; //debuglog("PC=%04X ReadMMC(%04X)=",pc,addr); WASWRITE=0; Current=MMC_to_Atom; at_process(); //debuglog("%02X\n",MMC_to_Atom); return Current; }
void main(void) { // they're static so they're heap based (check this ;) // static int i; static char received = 0; LATD = 0xff; CardType = 0; // no card CLOCKINIT(); // ensure all ADC channels, comparators are off // ADCON1 = 0b00001111; CMCON = 0x07; TRISA = 0b11011111; // enable PSP // TRISE = 0b00010111; REDLEDOFF(); GREENLEDOFF(); LEDPINSOUT(); configByte = ReadEEPROM(EE_SYSFLAGS); // copy the bootloader's version bytes out of program flash // memcpypgm2ram((void*)(&globalData[0]), (const rom far void *)12, 1); memcpypgm2ram((void*)(&globalData[1]), (const rom far void *)14, 1); blVersion = (globalData[0] << 4) + (globalData[1] & 0x0f); LATB = ReadEEPROM(EE_PORTBVALU); TRISB = ReadEEPROM(EE_PORTBTRIS); at_initprocessor(); RELEASEIRQ(); doneprocessing: ACTIVITYSTROBE(1); PIR1bits.PSPIF = 0; while (PIR1bits.PSPIF == 0) {} at_process(); goto doneprocessing; }
void at_cmd_addition( char *input ) { char* temp_input = input; Delay_ms( 100 ); while( !exception_f ) at_process(); dev_timer_stop(); while( !dev_tx( *( temp_input++ ) ) ); dev_adapter_reset(); dev_timer_restart(); }
void at_cmd( char *input ) { char* temp_input = input; Delay_ms( 100 ); at_parse( temp_input, &temp_cb, &temp_timer ); dev_timer_load( temp_timer ); while( cue_f ) at_process(); while( !dev_tx( *( temp_input++ ) ) ); dev_adapter_reset(); dev_timer_start(); }