Browse Source

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

feature/2015
tixiv 16 years ago
parent
commit
9917c5b72b
  1. 9
      animations/programm.c
  2. 5
      display_loop.c
  3. 11
      pgmspace.h
  4. 9
      scrolltext/font.h
  5. 4
      scrolltext/scrolltext3.c
  6. 1
      simulator/main.c

9
animations/programm.c

@ -87,6 +87,15 @@ void off()
#endif
#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){
clear_screen(0);

5
display_loop.c

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

11
pgmspace.h

@ -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

9
scrolltext/font.h

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

4
scrolltext/scrolltext3.c

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

1
simulator/main.c

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

Loading…
Cancel
Save