[103033] trunk/dports/emulators/simulavr

landonf at macports.org landonf at macports.org
Tue Feb 12 00:41:28 PST 2013


Revision: 103033
          https://trac.macports.org/changeset/103033
Author:   landonf at macports.org
Date:     2013-02-12 00:41:28 -0800 (Tue, 12 Feb 2013)
Log Message:
-----------
Backport at90can* device fixes from git master:
- Enable ELPM support: http://git.savannah.gnu.org/cgit/simulavr.git/commit/src/at90canbase.cpp?id=e3d323e664884003673a00559c14d8e799699b52
- Fix invalid interrupt vectors: http://git.savannah.gnu.org/cgit/simulavr.git/commit/src/at90canbase.cpp?id=6ef1c1455becac93f445c3100520ab498ecf240c

Modified Paths:
--------------
    trunk/dports/emulators/simulavr/Portfile

Added Paths:
-----------
    trunk/dports/emulators/simulavr/files/patch-at90can-elpm
    trunk/dports/emulators/simulavr/files/patch-at90can-ivs

Modified: trunk/dports/emulators/simulavr/Portfile
===================================================================
--- trunk/dports/emulators/simulavr/Portfile	2013-02-12 08:05:11 UTC (rev 103032)
+++ trunk/dports/emulators/simulavr/Portfile	2013-02-12 08:41:28 UTC (rev 103033)
@@ -5,7 +5,7 @@
 
 name              simulavr
 version           1.0.0
-revision          1
+revision          2
 categories        emulators devel
 maintainers       landonf
 description       Simulator for Atmel AVR microcontrollers
@@ -25,7 +25,9 @@
 
 patchfiles        patch-src_systemclock.cpp \
                   patch-msleep \
-                  patch-src_Makefile.in
+                  patch-src_Makefile.in \
+                  patch-at90can-ivs \
+                  patch-at90can-elpm
 
 post-patch {
     # Hack the swig macro into detecting a modern version of swig

Added: trunk/dports/emulators/simulavr/files/patch-at90can-elpm
===================================================================
--- trunk/dports/emulators/simulavr/files/patch-at90can-elpm	                        (rev 0)
+++ trunk/dports/emulators/simulavr/files/patch-at90can-elpm	2013-02-12 08:41:28 UTC (rev 103033)
@@ -0,0 +1,27 @@
+From e3d323e664884003673a00559c14d8e799699b52 Mon Sep 17 00:00:00 2001
+From: Petr Hluzin <email.is.fucking.required at invalid.invalid>
+Date: Sat, 06 Oct 2012 12:45:34 +0000
+Subject: AT90CAN128 has ELPM instruction.
+
+According to AT90CAN32/64/128 datasheet rev.H all three devices in the
+family have the ELPM instruction.
+
+Reported by and patch provided by Uwe Bonnes, thanks.
+http://savannah.nongnu.org/patch/?7850
+---
+(limited to 'src/at90canbase.cpp')
+
+diff --git a/src/at90canbase.cpp b/src/at90canbase.cpp
+index cbfef1a..da5b694 100644
+--- src/at90canbase.cpp
++++ src/at90canbase.cpp
+@@ -92,6 +92,7 @@ AvrDevice_at90canbase::AvrDevice_at90canbase(unsigned ram_bytes,
+           &portf.GetPin(6),
+           &portf.GetPin(7))
+ {
++    flagELPMInstructions = true;
+     flagJMPInstructions = (flash_bytes > 8U * 1024U) ? true : false;
+     irqSystem = new HWIrqSystem(this, (flash_bytes > 8U * 1024U) ? 4 : 2, 37);
+ 
+--
+cgit v0.9.0.2

Added: trunk/dports/emulators/simulavr/files/patch-at90can-ivs
===================================================================
--- trunk/dports/emulators/simulavr/files/patch-at90can-ivs	                        (rev 0)
+++ trunk/dports/emulators/simulavr/files/patch-at90can-ivs	2013-02-12 08:41:28 UTC (rev 103033)
@@ -0,0 +1,120 @@
+From 6ef1c1455becac93f445c3100520ab498ecf240c Mon Sep 17 00:00:00 2001
+From: Petr Hluzin <email.is.fucking.required at invalid.invalid>
+Date: Sat, 11 Aug 2012 18:33:23 +0000
+Subject: Fixed interrupt vectors for at90can* devices.
+
+Original code had bogus numbers for interrupt vector values and wrote
+past end of an array.
+Reported by Ytai Ben-tsvi.
+http://lists.gnu.org/archive/html/simulavr-devel/2012-07/msg00003.html
+---
+(limited to 'src/at90canbase.cpp')
+
+diff --git src/at90canbase.cpp b/src/at90canbase.cpp
+index 727e893..cbfef1a 100644
+--- src/at90canbase.cpp
++++ src/at90canbase.cpp
+@@ -93,9 +93,9 @@ AvrDevice_at90canbase::AvrDevice_at90canbase(unsigned ram_bytes,
+           &portf.GetPin(7))
+ {
+     flagJMPInstructions = (flash_bytes > 8U * 1024U) ? true : false;
+-    irqSystem = new HWIrqSystem(this, (flash_bytes > 8U * 1024U) ? 4 : 2, 26);
++    irqSystem = new HWIrqSystem(this, (flash_bytes > 8U * 1024U) ? 4 : 2, 37);
+ 
+-    eeprom = new HWEeprom(this, irqSystem, ee_bytes, 23, HWEeprom::DEVMODE_EXTENDED); 
++    eeprom = new HWEeprom(this, irqSystem, ee_bytes, 26, HWEeprom::DEVMODE_EXTENDED); 
+     stack = new HWStackSram(this, 16);
+ 
+     RegisterPin("AREF", &aref);
+@@ -116,8 +116,8 @@ AvrDevice_at90canbase::AvrDevice_at90canbase(unsigned ram_bytes,
+     extirq01->registerIrq(8, 7, new ExternalIRQSingle(eicrb_reg, 6, 2, GetPin("E7")));
+     
+     timerIrq0 = new TimerIRQRegister(this, irqSystem, 0);
+-    timerIrq0->registerLine(0, new IRQLine("TOV0",  16));
+-    timerIrq0->registerLine(1, new IRQLine("OCF0A", 15));
++    timerIrq0->registerLine(0, new IRQLine("TOV0",  17));  // TIMER0 OVF
++    timerIrq0->registerLine(1, new IRQLine("OCF0A", 16));  // TIMER0 COMP
+     
+     timer0 = new HWTimer8_1C(this,
+                              new PrescalerMultiplexerExt(&prescaler013, PinAtPort(&portd, 7)),
+@@ -127,11 +127,11 @@ AvrDevice_at90canbase::AvrDevice_at90canbase(unsigned ram_bytes,
+                              new PinAtPort(&portb, 7));
+ 
+     timerIrq1 = new TimerIRQRegister(this, irqSystem, 1);
+-    timerIrq1->registerLine(0, new IRQLine("TOV1",  14));
+-    timerIrq1->registerLine(1, new IRQLine("OCF1A", 13));
+-    timerIrq1->registerLine(2, new IRQLine("OCF1B", 12));
+-    timerIrq1->registerLine(3, new IRQLine("OCF1C", 11));
+-    timerIrq1->registerLine(5, new IRQLine("ICF1",  10));
++    timerIrq1->registerLine(0, new IRQLine("TOV1",  15));  // TIMER1 OVF
++    timerIrq1->registerLine(1, new IRQLine("OCF1A", 12));  // TIMER1 COMPA
++    timerIrq1->registerLine(2, new IRQLine("OCF1B", 13));  // TIMER1 COMPB
++    timerIrq1->registerLine(3, new IRQLine("OCF1C", 14));  // TIMER1 COMPC
++    timerIrq1->registerLine(5, new IRQLine("ICF1",  11));  // TIMER1 CAPT
+     
+     inputCapture1 = new ICaptureSource(PinAtPort(&portd, 4));
+     timer1 = new HWTimer16_3C(this,
+@@ -148,8 +148,8 @@ AvrDevice_at90canbase::AvrDevice_at90canbase(unsigned ram_bytes,
+                                inputCapture1);
+     
+     timerIrq2 = new TimerIRQRegister(this, irqSystem, 2);
+-    timerIrq2->registerLine(0, new IRQLine("TOV2",  9));
+-    timerIrq2->registerLine(1, new IRQLine("OCF2A", 7));
++    timerIrq2->registerLine(0, new IRQLine("TOV2",  10));  // TIMER2 OVF
++    timerIrq2->registerLine(1, new IRQLine("OCF2A", 9));  // TIMER2 COMP
+     
+     timer2 = new HWTimer8_1C(this,
+                              new PrescalerMultiplexer(&prescaler2),
+@@ -159,11 +159,11 @@ AvrDevice_at90canbase::AvrDevice_at90canbase(unsigned ram_bytes,
+                              new PinAtPort(&portb, 4));
+ 
+     timerIrq3 = new TimerIRQRegister(this, irqSystem, 3);
+-    timerIrq3->registerLine(0, new IRQLine("TOV3",  30));
+-    timerIrq3->registerLine(1, new IRQLine("OCF3A", 27));
+-    timerIrq3->registerLine(2, new IRQLine("OCF3B", 28));
+-    timerIrq3->registerLine(3, new IRQLine("OCF3C", 29));
+-    timerIrq3->registerLine(5, new IRQLine("ICF3",  26));
++    timerIrq3->registerLine(0, new IRQLine("TOV3",  31));  // TIMER3 OVF
++    timerIrq3->registerLine(1, new IRQLine("OCF3A", 28));  // TIMER3 COMPA
++    timerIrq3->registerLine(2, new IRQLine("OCF3B", 29));  // TIMER3 COMPB
++    timerIrq3->registerLine(3, new IRQLine("OCF3C", 30));  // TIMER3 COMPC
++    timerIrq3->registerLine(5, new IRQLine("ICF3",  27));  // TIMER3 CAPT
+ 
+     inputCapture3 = new ICaptureSource(PinAtPort(&porte, 7));
+     timer3 = new HWTimer16_3C(this,
+@@ -195,16 +195,16 @@ AvrDevice_at90canbase::AvrDevice_at90canbase(unsigned ram_bytes,
+ 
+     wado = new HWWado(this);
+ 
+-    acomp = new HWAcomp(this, irqSystem, PinAtPort(&porte, 2), PinAtPort(&porte, 3), 23);
++    acomp = new HWAcomp(this, irqSystem, PinAtPort(&porte, 2), PinAtPort(&porte, 3), 24);
+ 
+     usart0 = new HWUsart(this,
+                          irqSystem,
+                          PinAtPort(&porte,1),    // TXD
+                          PinAtPort(&porte,0),    // RXD
+                          PinAtPort(&porte,2),   // XCK
+-                         20,   // RX complete vector
+-                         21,   // UDRE vector
+-                         22,   // TX complete vector
++                         21,   // RX complete vector
++                         22,   // UDRE vector
++                         23,   // TX complete vector
+                          0);
+ 
+     usart1 = new HWUsart(this,
+@@ -212,9 +212,9 @@ AvrDevice_at90canbase::AvrDevice_at90canbase(unsigned ram_bytes,
+                          PinAtPort(&portd,3),    // TXD
+                          PinAtPort(&portd,2),    // RXD
+                          PinAtPort(&portd,5),   // XCK
+-                         31,   // RX complete vector
+-                         32,   // UDRE vector
+-                         33,   // TX complete vector
++                         32,   // RX complete vector
++                         33,   // UDRE vector
++                         34,   // TX complete vector
+                          1);
+ 
+ 
+--
+cgit v0.9.0.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130212/0b9744bf/attachment.html>


More information about the macports-changes mailing list