diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2017-08-11 22:11:43 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2017-08-11 22:11:43 +0200 |
| commit | f97f48ca7cefd3380edc9bdaaebf17c16c5c871b (patch) | |
| tree | 8fcc3e6cff095ba23ee8f18a9ce4d4c2521436b2 /Source/System.c | |
| parent | f17b15bdffe45810eebc7695c10f1d7fc34af014 (diff) | |
* IMASK is now accessed as volatile variable.
* Other minor changes.
Diffstat (limited to 'Source/System.c')
| -rw-r--r-- | Source/System.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/System.c b/Source/System.c index 1830582..e3dbb86 100644 --- a/Source/System.c +++ b/Source/System.c @@ -19,7 +19,7 @@ #define END_STACK_PATTERN (uint32_t) 0x18022015 #define BEGIN_STACK_ADDRESS (uint32_t*) 0x801FFF00 #define STACK_SIZE 0x1000 -#define I_MASK (*(unsigned int*)0x1F801074) +#define I_MASK (*(volatile unsigned int*)0x1F801074) /* ************************************* * Local Prototypes @@ -558,6 +558,11 @@ void SystemWaitCycles(uint32_t cycles) uint32_t SystemRand(uint32_t min, uint32_t max) { + if(rand_seed == false) + { + Serial_printf("Warning: calling rand() before srand()\n"); + } + return rand() % (max - min + 1) + min; } |
