Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xmc1100 (xmc2go) Hardware Support #42

Merged
merged 2 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions TinybasicArduino/TinybasicArduino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@
#define MEMSIZE 0
#ifdef ARDUINO_AVR_DUEMILANOVE
#define MEMSIZE 512
#elif defined(XMC1100_XMC2GO)
#define MEMSIZE 12000 //Not needed in Version 1.31, autodetected
#endif

/* debug mode switch */
Expand Down
21 changes: 19 additions & 2 deletions TinybasicArduino/hardware-arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,17 @@ const char zx81pins[] = {7, 8, 9, 10, 11, 12, A0, A1, 2, 3, 4, 5, 6 };
#undef STANDALONE
#endif

/* an xmc1100 board */
#if defined(XMC1100_XMC2GO)
// picocom /dev/ttyACM0 --omap crlf --imap lfcrlf
#undef USESPICOSERIAL
#undef ARDUINOUSBKBD
#undef ARDUINOEEPROM
#undef RP2040LITTLEFS
#undef ARDUINOPROGMEM
#undef USEMEMINTERFACE
#endif

/*
* defining the systype variable which informs BASIC about the platform at runtime
*/
Expand All @@ -521,7 +532,7 @@ const mem_t bsystype = SYSTYPE_UNKNOWN;
* the ARDUINO 100 definition is probably not needed anymore
*/

#if defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_MBED_RP2040)
#if defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_MBED_RP2040) || defined(XMC1100_XMC2GO)
#include <avr/dtostrf.h>
#define ARDUINO 100
#endif
Expand Down Expand Up @@ -871,7 +882,7 @@ void wiringbegin() {}
* Arduino information from
* data from https://docs.arduino.cc/learn/programming/memory-guide
*/
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM) || defined(XMC1100_XMC2GO)
extern "C" char* sbrk(int incr);
long freeRam() {
char top;
Expand Down Expand Up @@ -3007,6 +3018,10 @@ void dwrite(number_t p, number_t v){
*/
void pinm(number_t p, number_t m){
if (m == 0) m=INPUT; else if (m == 1) m=OUTPUT;
#if defined(XMC1100_XMC2GO)
if(m==0) pinMode(p, 0xc0UL);
if(m==1) pinMode(p, 0x80UL);
#endif
pinMode(p, m);
}

Expand Down Expand Up @@ -3113,7 +3128,9 @@ void byield() {
lastlongyield=millis();
}
#endif
#if !defined(XMC1100_XMC2GO)
delay(0);
#endif
}

/* everything that needs to be done often - 32 ms */
Expand Down