Make our systick interval a #define

This commit is contained in:
Stefan `Sec` Zehl 2011-07-27 00:25:24 +02:00
parent 139e61f827
commit 2da811bf61
3 changed files with 12 additions and 8 deletions

View File

@ -95,7 +95,7 @@ int lcdInitConfig(){
void main_default(void) {
systickInit(10);
systickInit(SYSTICKSPEED);
if(getInputRaw()==BTN_ENTER){
ISPandReset();
@ -118,7 +118,7 @@ void tick_default(void) {
static int ctr;
ctr++;
incTimer();
if(ctr>100){
if(ctr>1000/SYSTICKSPEED){
if(!adcMutex){
VoltageCheck();
LightCheck();
@ -133,7 +133,7 @@ void tick_default(void) {
else
backlightSetBrightness(0);
if(ctr%5==0){
if(ctr%(50/SYSTICKSPEED)==0){
if(GetVoltage()<3600
#ifdef SAFE
@ -142,7 +142,7 @@ void tick_default(void) {
){
IOCON_PIO1_11 = 0x0;
gpioSetDir(RB_LED3, gpioDirection_Output);
if( (ctr/5)%10 == 1 )
if( (ctr/(50/SYSTICKSPEED))%10 == 1 )
gpioSetValue (RB_LED3, 1);
else
gpioSetValue (RB_LED3, 0);
@ -151,3 +151,4 @@ void tick_default(void) {
return;
};

View File

@ -182,5 +182,7 @@ void handleMenu(const struct MENU *the_menu);
#include "basic/idle.h"
#define SYSTICKSPEED 10
#endif

View File

@ -22,7 +22,7 @@ void work_queue(void){
#ifdef __arm__
__asm volatile ("WFI");
#else
delayms(10);
delayms(SYSTICKSPEED);
#endif
return;
};
@ -36,13 +36,13 @@ void work_queue(void){
};
void delayms_queue(uint32_t ms){
int end=_timectr+ms/10;
int end=_timectr+ms/SYSTICKSPEED;
do {
if (the_queue.qstart == the_queue.qend){
#ifdef __arm__
__asm volatile ("WFI");
#else
delayms(10);
delayms(SYSTICKSPEED);
#endif
}else{
work_queue();
@ -51,12 +51,13 @@ void delayms_queue(uint32_t ms){
};
void delayms_power(uint32_t ms){
ms/=SYSTICKSPEED;
ms+=_timectr;
do {
#ifdef __arm__
__asm volatile ("WFI");
#else
delayms(10);
delayms(SYSTICKSPEED);
#endif
} while (ms >_timectr);
};