]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avr/init.asm
Remove unsupported experimental ADC support
[avrcpm.git] / avr / init.asm
index 41626dd285bf7d1c19c14de1bd85c2ef77860e15..dcc945992e0a75553d25c80689a89832bf49d547 100644 (file)
@@ -18,7 +18,7 @@
 ;    You should have received a copy of the GNU General Public License
 ;    along with avrcpm.  If not, see <http://www.gnu.org/licenses/>.
 ;
-;    $Id$
+;    $Id: init.asm 241 2015-12-10 09:38:25Z rapid $
 ;
 
 #define REFR_PRE    8           /* timer prescale factor  1/8 */
@@ -58,7 +58,7 @@ cp_l: lpm     xh,z+
        outm8   WDTCSR,temp
        ldi temp,(1<<WDCE)
        outm8   WDTCSR,temp
-       
+
 ; - Setup Ports
 
 ;      ldi     temp,(1<<PUD)           ;disable pullups
@@ -66,10 +66,15 @@ cp_l:       lpm     xh,z+
        out     PORTD,_255              ;all pins high (enables pullup on input ports)
        out     PORTB,_255
        out     PORTC,_255
-       out     DDRD,_255               ; all outputs
-       out     DDRB,_255
-       out     DDRC,_255
-       cbi     P_RXD-1,RXD             ; RXD pin is input
+       out     DDRD,_255               ; PD all outputs
+#if I2C_SUPPORT
+       ldi     temp,~((1<<SCL)|(1<<SDA))
+       out     DDRC,temp
+#endif
+#if DRAM_8BIT
+       ldi     temp,~(1<<RXD)
+       out     DDRB,temp
+#endif
 
        outm8   TIMSK1,_0
        outm8   TIMSK2,_0
@@ -100,8 +105,8 @@ fill_loop:
 
 ; Init timer 1 as 1 ms system clock tick.
 
-       ldi     temp, low (F_CPU/1000)
-       ldi     temp2,high(F_CPU/1000)
+       ldi     temp, low (TC_1MS)
+       ldi     temp2,high(TC_1MS)
        outm8   OCR1BH,temp2
        outm8   OCR1BL,temp
        ldi     temp,(1<<ICNC1)|(1<<CS10)       ;Noise cancel, fall. edge, Normal Mode, clk/1
@@ -113,7 +118,7 @@ fill_loop:
 ; - Init serial port
 
        rcall   uart_init
-       
+
 ;Init timer2. Refresh-call should happen every (8ms/512) cycles.
 
        ldi     temp,REFR_CNT*2                 ; 2 cycles per int
@@ -143,10 +148,10 @@ fill_loop:
 .endif
 
        rcall   printstr
-       .db     13,13,"CPM on an AVR, v"
-       db_version VMAJOR, VMINOR
-       printstring " r" SVN_REVSTR " " TESTSTR
-               
+       .db     '\r', '\r'
+version_string:
+       makestring "CPM on an AVR, v" VERS_STR " r" SVN_REVSTR TESTSTR
+
 .if MEMTEST
        printnewline
        printstring "Testing RAM: fill..."
@@ -176,7 +181,7 @@ ramtestr:
        rcall   dram_read
 
 ;      ori     temp,0x04               ;simulate error
-;      andi    temp,0xF7
+;      andi    temp,0xF7               ;another error
 
        mov     temp2,xh
        eor     temp2,xl
@@ -219,7 +224,7 @@ ramtestrok:
        brcc    ramtestr
 ramtestrex:
        tst     temp3                   ;any errors?
-       breq    ramtestend      
+       breq    ramtestend
 
        printstring " System halted!"
 halted_loop:
@@ -275,13 +280,13 @@ boot_iplwl:
        dec     temp2
        brne    boot_iplwl
        rjmp    boot_again
-       
+
 
 boot_ipl2:
        lcall   mgr_prnt_parttbl
        printnewline
        printstring "Partinit done."
-       
+
 ; Init (de)blocking buffer
 
        lcall   dsk_inval_hostbuf
@@ -302,7 +307,7 @@ boot_ipl2:
        ldiw    x,IPLADDR
        std     y+o_dmaadr+0,xl
        std     y+o_dmaadr+1,xh
-       
+
        ldi     temp,1<<READ_FUNC
        lcall   dskDoIt
 
@@ -311,4 +316,3 @@ boot_ipl2:
 
 
 ; vim:set ts=8 noet nowrap
-