Skip to content

Commit

Permalink
Tweaks to get it compiling for desktop again.
Browse files Browse the repository at this point in the history
Sorry about that.
  • Loading branch information
Scott Lawrence committed Jan 2, 2013
1 parent 18f45f6 commit 133ef40
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions Arduino/TinyBasicPlus.ino
Expand Up @@ -143,6 +143,8 @@ char eliminateCompileErrors = 1; // fix to suppress arduino build errors
#else
// Not arduino setup
#include <stdio.h>
#include <stdlib.h>
#undef ENABLE_TONES

// size of our program ram
#define kRamSize 4096
Expand Down Expand Up @@ -715,6 +717,7 @@ static short int expr4(void)
return -a;
return a;

#ifdef ARDUINO
case FUNC_AREAD:
#ifdef kAutoConf
pinMode( a, INPUT );
Expand All @@ -725,9 +728,14 @@ static short int expr4(void)
pinMode( a, INPUT );
#endif
return digitalRead( a );
#endif

case FUNC_RND:
#ifdef ARDUINO
return( random( a ));
#else
return( rand() % a );
#endif
}
}

Expand Down Expand Up @@ -863,8 +871,10 @@ void loop()
boolean alsoWait = false;
int val;

#ifdef ARDUINO
#if ENABLE_TONES
noTone( kPiezoPin );
#endif
#endif

program_start = program;
Expand Down Expand Up @@ -1550,7 +1560,6 @@ dwrite:
#endif

/*************************************************/

files:
// display a listing of files on the device.
// version 1: no support for subdirectories
Expand All @@ -1560,7 +1569,7 @@ files:
goto warmstart;
#else
goto unimplemented;
#endif
#endif // ENABLE_FILEIO


chain:
Expand Down Expand Up @@ -1591,17 +1600,17 @@ load:
fp = SD.open( (const char *)filename );
inFromFile = true;
inhibitOutput = true;
#else
}
#else // ARDUINO
// Desktop specific
#endif
#endif // ARDUINO
// this will kickstart a series of events to read in from the file.
}

}
goto warmstart;
#else
#else // ENABLE_FILEIO
goto unimplemented;
#endif
#endif // ENABLE_FILEIO



Expand Down Expand Up @@ -1635,15 +1644,16 @@ save:
// go back to standard output, close the file
outToFile = false;
fp.close();
#else
#else // ARDUINO
// desktop
#endif
#endif // ARDUINO

goto warmstart;
}
#else
#else // ENABLE_FILEIO
goto unimplemented;
#endif
#endif // ENABLE_FILEIO

rseed:
{
short int value;
Expand All @@ -1654,7 +1664,11 @@ rseed:
if(expression_error)
goto qwhat;

#if ARDUINO
randomSeed( value );
#else // ARDUINO
srand( value );
#endif // ARDUINO
goto run_next_statement;
}

Expand Down Expand Up @@ -1723,7 +1737,7 @@ static int isValidFnChar( char c )
return 0;
}

static unsigned char * filenameWord(void)
unsigned char * filenameWord(void)
{
// SDL - I wasn't sure if this functionality existed above, so I figured i'd put it here
unsigned char * ret = txtpos;
Expand Down

0 comments on commit 133ef40

Please sign in to comment.