changeset 485:e83f883c96b2

quick fix for wrong wait routines
author heinrichsweikamp
date Sat, 15 Oct 2011 13:45:15 +0200
parents 65850b513f1b
children c7b663939737
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/wait.asm
diffstat 2 files changed, 29 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Thu Oct 13 09:54:21 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Sat Oct 15 13:45:15 2011 +0200
@@ -35,7 +35,7 @@
 ;#DEFINE	SPANISH							; Use spanish_text.asm
 ;#DEFINE	RUSSIAN							; Use russian_text.asm
 
-;#DEFINE	__DEBUG	; 
+#DEFINE	__DEBUG	; 
 ;#DEFINE	DISPLAY_TEST	; Enables Display-Test in RAW data menu
 
 #DEFINE	logbook_profile_version	0x21        ; Do not touch!
@@ -48,11 +48,13 @@
 ;  	#DEFINE	OSCCON_VALUE  	b'01101100'		; 4MHz (x4 PLL)
 ;	#DEFINE	SSPADD_VALUE	d'8'			; 400kHz I2C clock @ 16MHz Fcy
 ;	#DEFINE	T0CON_VALUE		b'00011111'		; Timer0
+; 	#DEFINE	SPEED_16MHz
 ; Experimental 32MHz mode
 	#DEFINE	SPBRG_VALUE 	d'68'
   	#DEFINE	OSCCON_VALUE  	b'01111100'		; 8MHz (x4 PLL)
 	#DEFINE	SSPADD_VALUE	d'16'			; 400kHz I2C clock @ 32MHz Fcy
 	#DEFINE	T0CON_VALUE 	b'00010000'		; Timer0
+ 	#DEFINE	SPEED_32MHz
 
 #DEFINE		FT_SMALL		.0
 #DEFINE		FT_MEDIUM		.1
@@ -110,8 +112,8 @@
 
 ;=============================================================================
 
-#include "../OSTC_code_c_part2/shared_definitions.h"
-;#include "ostc2_code/code_part1/OSTC_code_c_part2/shared_definitions.h"
+;#include "../OSTC_code_c_part2/shared_definitions.h"
+#include "ostc2_code/code_part1/OSTC_code_c_part2/shared_definitions.h"
 ;include "shared_definitions.h"
 
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/wait.asm	Thu Oct 13 09:54:21 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/wait.asm	Sat Oct 15 13:45:15 2011 +0200
@@ -20,10 +20,22 @@
 ; ==========================================================
 ; 	WAIT 10 MICROSECONDS  -  16 MHZ
 ; ==========================================================
+
+	IFDEF	SPEED_16MHz
 WAIT10US 	macro	wait_temp
 			movlw	wait_temp
 			call	WAIT10USX
 			endm
+	ENDIF
+
+	IFDEF	SPEED_32MHz
+WAIT10US 	macro	wait_temp
+			movlw	wait_temp
+			call	WAIT10USX
+			movlw	wait_temp
+			call	WAIT10USX
+			endm
+	ENDIF
 
 WAIT10USX	movwf	wait_temp
 			goto	JumpIn10us
@@ -71,10 +83,22 @@
 ; ==========================================================
 ; 	WAIT 1 MILLISECOND  -  16 MHZ
 ; ==========================================================
+	IFDEF	SPEED_16MHz
 WAITMS		macro	waitms_temp
 			movlw	waitms_temp
 			call WAITMSX
 			endm
+	ENDIF
+
+	IFDEF	SPEED_32MHz
+WAITMS		macro	waitms_temp
+			movlw	waitms_temp
+			call WAITMSX
+			movlw	waitms_temp
+			call WAITMSX
+			endm
+	ENDIF
+
 WAITMSX		movwf	waitms_temp
 			goto	JumpInMSX
 WAITMSX2	nop