simulation supports scrolltext now. Own pgmspace.h added which works around pgmspace functions not being available on PC.

This commit is contained in:
tixiv 2008-12-05 02:53:09 +00:00
parent 1598091e0c
commit 9917c5b72b
6 changed files with 25 additions and 14 deletions

View File

@ -87,6 +87,15 @@ void off()
#endif #endif
#ifdef ANIMATION_SPIRALE #ifdef ANIMATION_SPIRALE
void walk(cursor* cur, unsigned char steps, unsigned int delay){
unsigned char x;
for(x=0;x<steps;x++){
set_cursor(cur, next_pixel(cur->pos, cur->dir));
wait(delay);
}
}
void spirale(unsigned int delay){ void spirale(unsigned int delay){
clear_screen(0); clear_screen(0);

View File

@ -1,5 +1,6 @@
#include <setjmp.h> #include <setjmp.h>
#include <stdio.h>
#include "config.h" #include "config.h"
#include "scrolltext/scrolltext.h" #include "scrolltext/scrolltext.h"
@ -33,10 +34,6 @@ void display_loop(){
#ifdef ANIMATION_SCROLLTEXT #ifdef ANIMATION_SCROLLTEXT
case 1: case 1:
scrolltext(scrolltext_text); scrolltext(scrolltext_text);
{ char a[14];
sprintf(a,"</# counter == %lu ", percnt_get());
scrolltext(a);
}
break; break;
#endif #endif

11
pgmspace.h Normal file
View File

@ -0,0 +1,11 @@
//pc compatibility of AVR-pgmspace stuff for compiling simulator
#ifdef AVR
#include <avr/pgmspace.h>
#else
#define PROGMEM
#define strcpy_P strcpy
#define memcpy_P memcpy
#define pgm_read_byte(a) ((*(uint8_t*)(a)))
#define pgm_read_word(a) ((*(uint16_t*)(a)))
#endif

View File

@ -1,12 +1,7 @@
#ifndef FONT_H #ifndef FONT_H
#define FONT_H #define FONT_H
#ifdef AVR
# include <avr/pgmspace.h> #include "../pgmspace.h"
#else
# define PROGMEM
# define pgm_read_byte(B) *(B)
# define pgm_read_word(B) *(B)
#endif
typedef struct{ typedef struct{
unsigned char fontHeight; unsigned char fontHeight;

View File

@ -6,12 +6,10 @@
#include "../config.h" #include "../config.h"
#include "scrolltext.h" #include "scrolltext.h"
#ifdef AVR
# include "../borg_hw/borg_hw.h"
#endif
#include "../pixel.h" #include "../pixel.h"
#include "../util.h" #include "../util.h"
#include "../pgmspace.h"
#include "font_arial8.h" #include "font_arial8.h"
#include "font_small6.h" #include "font_small6.h"
#include "font_uni53.h" #include "font_uni53.h"

View File

@ -197,6 +197,7 @@ void timf(int value) {
void *display_loop_run(void * unused) { void *display_loop_run(void * unused) {
display_loop(); display_loop();
return 0;
} }
int main(int argc, char **argv){ int main(int argc, char **argv){