A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: Function create_function() is deprecated
Filename: geshi/geshi.php
Line Number: 4751
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
MPSTermin3 - mcpaste
// Lösung zu Termin3
// Aufgabe 1
// von:
// vom:
//
#include "../h/pmc.h"
#include "../h/tc.h"
#include "../h/pio.h"
#include "../h/aic.h"
void taste_irq_handler (void) __attribute__ ((interrupt));
// Interruptserviceroutine für die Tasten SW1 und SW2
void taste_irq_handler (void)
{
StructPIO* piobaseA = PIOA_BASE;
StructPIO* piobaseB = PIOB_BASE; // Basisadresse PIO B
StructAIC* aicbase = AIC_BASE; // Basisadresse des Advanced interrupt controllers
// ab hier entsprechend der Aufgabestellung ergänzen
// *************************************************
if(!(piobaseB->PIO_PDSR & KEY1))
{
piobaseA->PIO_PER = (1<<PIOTIOA3) ; // Pinport A3 enable
}
if(!(piobaseB->PIO_PDSR & KEY2))
{
piobaseA->PIO_PDR = (1<<PIOTIOA3);
}
aicbase->AIC_EOICR = piobaseB->PIO_ISR; //Ende der Interruptserviceroutine
}
// Timer3 initialisieren
void Timer3_init( void )
{
StructTC* timerbase3 = TCB3_BASE; // Basisadressse TC Block 1
StructPIO* piobaseA = PIOA_BASE; // Basisadresse PIO B
timerbase3->TC_CCR = TC_CLKDIS; // Disable Clock
// Initialize the mode of the timer 3
timerbase3->TC_CMR =
TC_ACPC_CLEAR_OUTPUT | //ACPC : Register C clear TIOA
TC_ACPA_SET_OUTPUT | //ACPA : Register A set TIOA
TC_WAVE | //WAVE : Waveform mode
TC_CPCTRG | //CPCTRG : Register C compare trigger enable
TC_CLKS_MCK8; //TCCLKS : MCKI / 8
// Initialize the counter:
timerbase3->TC_RA = 31250; //50% High
timerbase3->TC_RC = 62500; //
// Start the timer :
timerbase3->TC_CCR = TC_CLKEN ; // Timer Enable
timerbase3->TC_CCR = TC_SWTRG ; // Softwaretrigger
piobaseA->PIO_PER = (1<<PIOTIOA3) ; // Pinport A3 enable
piobaseA->PIO_OER = (1<<PIOTIOA3) ; // Outputenable
piobaseA->PIO_CODR = (1<<PIOTIOA3) ; // Clear output data register -> kein anderes signal liegt an
}
int main(void)
{
StructPMC* pmcbase = PMC_BASE; // Basisadresse des PMC
StructPIO* piobaseA = PIOA_BASE; // Basisadresse PIO A
StructPIO* piobaseB = PIOB_BASE; // Basisadresse PIO B
StructAIC* aicbase = AIC_BASE;
pmcbase->PMC_PCER = 0x6200; // Peripheral Clocks einschalten für PIOB, Timer3
// ab hier entsprechend der Aufgabestellung ergänzen
//**************************************************
Timer3_init();
piobaseA->PIO_PDR = (1<<PIOTIOA3);
piobaseB->PIO_PER = KEY1 | KEY2;
/*########### Interrupt Service Routine ausführbar machen ################*/
aicbase->AIC_IDCR = 1 << 14;
aicbase->AIC_ICCR = 1 << 14;
aicbase->AIC_SVR[PIOB_ID] = (unsigned int)taste_irq_handler;
aicbase->AIC_SMR[PIOB_ID] = 0x7;
aicbase->AIC_IECR = 1 << 14;
piobaseB->PIO_IER = KEY1 | KEY2;
while(1)
{
}
aicbase->AIC_IDCR = 1 << 14; // Interrupt PIOB ausschalten
aicbase->AIC_ICCR = 1 << 14; // Interrupt PIOB löschen
return 0;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876