Skip to content

Commit 347c9df

Browse files
committed
Enable Arduino interface for Teensy
1 parent a0b3dac commit 347c9df

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

ArduinoInterface/readme.txt

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
Additional BDOS calls for Arduino.
1+
Additional BDOS calls for Arduino / Teensy.
2+
3+
HostOS is available for all platforms - see cpm.h
24

35
=====================================================
46

@@ -47,3 +49,12 @@ BDOS function 224 (0xE0) - AnalogWrite:
4749
LD E, value (0-255)
4850
CALL 5
4951

52+
=====================================================
53+
54+
BDOS function 250 (0xFA) - HostOS:
55+
56+
LD C, 250
57+
CALL 5
58+
59+
Returns result in HL (1 = Arduino, 4 = Teensy).
60+

RunCPM/abstraction_arduino.h

+4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
#define printf(a, b) Serial.println(b)
66
#endif
77

8+
#ifdef CORE_TEENSY
9+
#define HostOS 0x04
10+
#else
811
#define HostOS 0x01
12+
#endif
913

1014
/* Memory abstraction functions */
1115
/*===============================================================================*/

RunCPM/cpm.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ void _Bdos(void) {
696696
case 40:
697697
HL = _WriteRand(DE);
698698
break;
699-
#ifdef ARDUINO
699+
#if defined ARDUINO || defined CORE_TEENSY
700700
/*
701701
C = 220 (DCh) : PinMode
702702
*/
@@ -730,7 +730,7 @@ void _Bdos(void) {
730730
#endif
731731
/*
732732
C = 250 (FAh) : HostOS
733-
Returns: A = 0x00 - Windows / 0x01 - Arduino / 0x02 - Posix / 0x03 - Dos
733+
Returns: A = 0x00 - Windows / 0x01 - Arduino / 0x02 - Posix / 0x03 - Dos / 0x04 - Teensy
734734
*/
735735
case 250:
736736
HL = HostOS;

0 commit comments

Comments
 (0)