Commit 9c012400 authored by lcgamboa's avatar lcgamboa

new: support to atmega2560

parent 761728d7
......@@ -17,7 +17,7 @@ execdir= ${prefix}/bin/
override CFLAGS += -DEXT_BROWSER -D_VERSION_=\"${VERSION}\" -Wall -ggdb -D_SHARE_=\"${sharedir}\" -I/usr/include/lxrad_X11 -Wall -D_REENTRANT
#override CFLAGS+= -D_NOTHREAD
override CFLAGS+=-fsanitize=address
#override CFLAGS+=-fsanitize=address
override CFLAGS+= -D_EXPERIMENTAL_
#LIBS = `lxrad_X11-config --libs` -lpicsim -lsimavr -lelf -lminizip
......
......@@ -347,9 +347,9 @@ cboard_0::Draw(CDraw *draw, double scale)
draw->Canvas.Rectangle (1, output[i].x1, output[i].y1, output[i].x2 - output[i].x1, output[i].y2 - output[i].y1);
break;
case O_MP:
lxFont font ((MGetPinCount () > 14)? 12 :10, lxFONTFAMILY_TELETYPE, lxFONTSTYLE_NORMAL, lxFONTWEIGHT_NORMAL);
lxFont font ((MGetPinCount () > 14) ? 12 : 10, lxFONTFAMILY_TELETYPE, lxFONTSTYLE_NORMAL, lxFONTWEIGHT_NORMAL);
draw->Canvas.SetFont (font);
ps = micbmp->GetSize ();
......@@ -378,7 +378,7 @@ cboard_0::Run_CPU(void)
int j;
unsigned char pi;
const picpin * pins;
unsigned int alm[40];
unsigned int alm[100];
int JUMPSTEPS = 0;
//long int NSTEPJ = 0;
......@@ -450,7 +450,7 @@ cboard_0::Run_CPU(void)
memset (alm, 0, pinc * sizeof (unsigned int));
//read pic.pins to a local variable to speed up
pins = board_avr::MGetPinsValues ();
if (use_spare)Window5.PreProcess ();
......@@ -593,39 +593,40 @@ cboard_0::MInit(const char * processor, const char * fname, float freq)
break;
}
if (!ret)
lxImage image;
switch (MGetPinCount ())
{
lxImage image;
case 8:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic08.png"));
break;
case 14:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic14.png"));
break;
case 18:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic18.png"));
break;
case 20:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic20.png"));
break;
case 28:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic28.png"));
break;
case 40:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic40.png"));
break;
case 100:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic100.png"));
break;
default:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic40.png"));
printf ("IC package with %i pins not found!\n", MGetPinCount ());
break;
}
switch (MGetPinCount ())
{
case 8:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic08.png"));
break;
case 14:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic14.png"));
break;
case 18:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic18.png"));
break;
case 20:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic20.png"));
break;
case 28:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic28.png"));
break;
case 40:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic40.png"));
break;
default:
image.LoadFile (Window1.GetSharePath () + lxT ("boards/ic40.png"));
printf ("IC package with %i pins not found!\n", MGetPinCount ());
break;
}
if (micbmp) delete micbmp;
micbmp = new lxBitmap (image, &Window1);
if (micbmp) delete micbmp;
micbmp = new lxBitmap (image, &Window1);
}
return ret;
}
......
......@@ -86,7 +86,7 @@ class cboard_0:public board_pic, public board_avr
void Run_CPU(void);
//Return a list of board supported microcontrollers
#ifdef _EXPERIMENTAL_
String GetSupportedDevices(void){return lxT("atmega328p,PIC16F18324,PIC16F18855,PIC16F1619,PIC16F1788,PIC16F1789,PIC16F1939,PIC16F628A,PIC16F648A,PIC16F84A,PIC16F777,PIC16F877A,PIC18F452,PIC18F4520,PIC18F4550,PIC18F45K50,PIC18F4620,PIC18F27K40,PIC18F47K40,");};
String GetSupportedDevices(void){return lxT("atmega328p,atmega2560,PIC16F18324,PIC16F18855,PIC16F1619,PIC16F1788,PIC16F1789,PIC16F1939,PIC16F628A,PIC16F648A,PIC16F84A,PIC16F777,PIC16F877A,PIC18F452,PIC18F4520,PIC18F4550,PIC18F45K50,PIC18F4620,PIC18F27K40,PIC18F47K40,");};
#else
String GetSupportedDevices(void){return lxT("atmega328p,PIC16F628A,PIC16F648A,PIC16F84A,PIC16F777,PIC16F877A,PIC18F452,PIC18F4550,PIC18F4620,");};
#endif
......
This diff is collapsed.
......@@ -96,8 +96,7 @@ class board_avr: virtual public board
avr_t * avr;
avr_irq_t * serial_irq;
picpin pins[256];
//FIXME only for atmega328 suppport
avr_irq_t * Write_stat_irq[28];
avr_irq_t * Write_stat_irq[100];
unsigned int serialbaud;
float serialexbaud;
void pins_reset(void);
......
......@@ -30,7 +30,7 @@
#include"parts/part.h"
#include"parts/parts_defs.h"
#define IOINIT 70
#define IOINIT 110
/**
* @brief CPWindow4 class
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment