Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Where are older eleases?
19-09-2015, 09:25 PM, (This post was last modified: 22-09-2015, 09:36 AM by gtcbreizh.)
#1
[SOLVED] Where are older eleases?
Hey, where are the older releases of pinguino IDE?
I need a feature (SPI/Ethernet) which was broken sometime after July 2014.
Please help me.
Thanks!
Reply
20-09-2015, 09:54 AM, (This post was last modified: 20-09-2015, 09:59 AM by gtcbreizh.)
#2
RE: Where are older eleases?
(19-09-2015, 09:25 PM)B4lfiz4r Wrote: Hey, where are the older releases of pinguino IDE?
I need a feature (SPI/Ethernet) which was broken sometime after July 2014.
Please help me.
Thanks!

Replace in the folder p8/include/pinguino/core the files spi.c spi.h by the attached ones.
For me it works for 47j53 and 26j50 chips.

NB : add #define SPIINIT as first line in your test file

The example in http://wiki.pinguino.cc/index.php/Ethern...web_server and a little documentation in  http://wiki.pinguino.cc/index.php/Catego...et_Library can help you.

Without sensors connected to a Pinguino board the interest of the enc28j60 is very limited.

Bye
André


Attached Files
.c   spi.c (Size: 8.11 KB / Downloads: 5)
.h   spi.h (Size: 5.22 KB / Downloads: 6)
Reply
20-09-2015, 04:46 PM,
#3
RE: Where are older eleases?
Thank you!
Now it is compiling:
Code:
#define SPIINIT

static u8 mymac[6] = {0x47,0x54,0x43,0x10,0x20,0x30};
static u8 myip[4]  = {192,168,0,10}; // you can select another one
static u8 mywwwport = 80; // listen port for tcp/www (max range 1-254)



void setup(){
  Ethernet.init(mymac,myip,mywwwport);
}

void loop() {
    // put your main code here, to run repeatedly:

}

But it:
Code:
/*********************************************
Author:    Andre Gentric
Date: Jul 5 2014
Description:
Application to demonstrate the capabilities of ENC28J60/ETHERNET lib.
It is based on the http://tuxgraphics.org/electronics DIY projects.
Thanks to Guido Socher.
This requests a enc28j60 module, easily found on the online market.
Tested with a 47j53-A board.
The 47j53-A communicates with the enc28j60 module thru the SPI/MSSP module.
The enc28j60 is powered from an external 3.3V and is linked to a PC thru a
Dlink router, connected itself to a DSL modem.
Therefore we can also communicate with web servers, if necessary, by programming  
the 47j53-A as a client.
We use a DS18B20 as temperature sensor powered with external 3.3V and a MPX4115AP
as pressure sensor powered with external 5V.
It is important to get 3.3 and 5V from an external source in order to keep a
fixed and stable voltage to ensure good analog measurements (ref. MPX4115AP).  
Effectively taking 3.3V from the Pinguino board we notice the voltage on the  
18f47j53 chip decreases from 3.21V to 3.06V.
On the PC the web browser (chrome or chromium in our case) is listening at
192.168.0.10 according our enc28j60 programming.
As we want to prevent our i/o data to be modified without authorization we have
introduced a password. So to start the i/o data displaying we have to enter as
URL on your browser : http://192.168.0.10/ then we enter your password as it is in
the program, here secret that we can change.
This is to modify according your programmed choices.
In this demo we propose :
- 4 digital outputs RD0 to RD3. On each of these pins you can connect either LED,
either transistor / relay
- 2 digital inputs RD4 and RD5 to enter, for instance, button controls
- 2 analog inputs RA0 and RA1 - voltage limited to 3.3V
For the DS18B20 use refer to the Pinguino examples and 1wire library. Here the
output is connected to pin #6.
The MPX4115AP output divided thru a voltage divider circuit(22K & 33K resistors)
is connected to pin #8 (above RA0)
Notice when we press Home, Get Temperature or Get Pressure button led on pin#24
switches on during 500 ms.
*********************************************/
#include <stdlib.h>
#define SPIINIT
// please modify the following two lines. mac and ip have to be unique
// in your local area network. You can not have the same numbers in
// two devices:
static uint8_t mymac[6] = {0x47,0x54,0x43,0x10,0x20,0x30};
static uint8_t myip[4]  = {192,168,0,10};
static char baseurl[]   = "http://192.168.0.10/"; // you can select something else
static uint16_t mywwwport = 80; // listen port for tcp/www (max range 1-254)

#define BUFFER_SIZE 800
static uint8_t buf[BUFFER_SIZE+1];
static volatile uint8_t stepcounter=0;
// global string buffer
#define STR_BUFFER_SIZE 24
static char strbuf[STR_BUFFER_SIZE+1];
static uint16_t gPlen;
// name of this switch (title on the main webpage)
static char label[30]="Welcome to the IO-web server"; // must not be longer than 20 char
//
// password (only a-z,0-9,_ characters): put your own pwd
static char password[9]="secret"; // must not be longer than 9 char
//
// Max amount of switches (0..3) to display on the webpage:
#define MAX_RELAY 4
// the positions on PORTD where the leds/relays are connected:
// based upon use of 47j53-A Pinguino board:
static uint8_t relay2port[MAX_RELAY] = {24,25,26,27}; // RD0, RD1, RD2, RD3
#define MAX_D_INPUT 2
static uint8_t d_input2port[MAX_D_INPUT] = {28,29};

// prepare the webpage by writing the data to the tcp send buffer
uint16_t http200ok(void);
uint16_t print_webpage_entry(uint8_t *buf);
uint16_t print_webpage(uint8_t *buf);
uint16_t print_webpage_io(void);
int8_t analyse_get_url(char *str);

uint8_t verify_password(char *str);
void usage(void);
uint8_t find_key_val(char *str,char *strbuf, uint8_t maxlen,char *key);

// get current temperature and pressure
#define ONEWIREBUS    6    // according your DS18B20 schematics - pin# connected to DQ line
void getCurrentTemp (char *temp);
void getCurrentPr (char *pr);

//
uint8_t verify_password(char *str)
{
        // the first characters of the received string are
        // a simple password/cookie:
        if (strncmp(password,str,strlen(password))==0){
                return(1);
        }
        return(0);
}

void usage(void){
  gPlen=fill_tcp_data(buf,http200ok(),"<p>Usage: http://host_or_ip/password</p>\n");
}

// search for a string of the form key=value in
// a string that looks like q?xyz=abc&uvw=defgh HTTP/1.1\r\n
//
// The returned value is stored in strbuf. You must allocate
// enough storage for strbuf, maxlen is the size of strbuf.
// I.e the value it is declated with: strbuf[5]-> maxlen=5
uint8_t find_key_val(char *str,char *strbuf, uint8_t maxlen,char *key)
{
  uint8_t found=0;
  uint8_t i=0;
  char *kp;
  kp=key;
  while(*str &&  *str!=' ' && *str!='\n' && found==0){
    if (*str == *kp){
      kp++;
      if (*kp == '\0'){
        str++;
        kp=key;
        if (*str == '='){
          found=1;
        }
      }
    }else{
      kp=key;
    }
    str++;
  }
  if (found==1){
  // copy the value to a buffer and terminate it with '\0'
    while(*str &&  *str!=' ' && *str!='\n' && *str!='&' && i<maxlen-1){
      *strbuf=*str;
      i++;
      str++;
      strbuf++;
    }
    *strbuf='\0';
  }
  // return the length of the value
  return(i);
}

// convert a single hex digit character to its integer value
unsigned char h2int(char c)
{
        if (c >= '0' && c <='9'){
                return((unsigned char)c - '0');
        }
        if (c >= 'a' && c <='f'){
                return((unsigned char)c - 'a' + 10);
        }
        if (c >= 'A' && c <='F'){
                return((unsigned char)c - 'A' + 10);
        }
        return(0);
}

// decode a url string e.g "hello%20joe" or "hello+joe" becomes "hello joe"
void urldecode(char *urlbuf)
{
        char c;
        char *dst;
        dst=urlbuf;
        while ((c = *urlbuf)) {
                if (c == '+') c = ' ';
                if (c == '%') {
                        urlbuf++;
                        c = *urlbuf;
                        urlbuf++;
                        c = (h2int(c) << 4) | h2int(*urlbuf);
                }
                *dst = c;
                dst++;
                urlbuf++;
        }
        *dst = '\0';
}


// takes a string of the form confirm?pw=xxx&rst=1 and analyse it
// return values: -3 no valid password
//                 1 passpword OK
int8_t analyse_get_url(char *str)
{
  uint8_t loop=15;
  int8_t i;
  uint8_t on=0;
  uint8_t port, r;
    if (strncmp("confirm",str,7)==0){
      if (find_key_val(str,strbuf,STR_BUFFER_SIZE,"pw")){
        urldecode(strbuf);
        if (verify_password(strbuf)==0){
          return(-3);
        }else{
          return(1);
        }
      }else{
        return(-3);
      }
      }

  if (find_key_val (str,strbuf,STR_BUFFER_SIZE,"cmd")) {
    if (*strbuf < 0x3a && *strbuf > 0x2f) {
      // is a ASCII number, return it
      r = (*strbuf-0x30);
    }
    return r;
  }


  // str is now something like password/?sw=rdx&a=1 or just end of url
  if (find_key_val(str,strbuf,STR_BUFFER_SIZE,"sw")){
    if (strbuf[0] != 'r'){
      return(0);
    }
    if (strbuf[1] != 'd'){
      return(0);
    }
    if (strbuf[2] < 0x3a && strbuf[2] > 0x2f){
    // is a ASCII number, return it
      port=strbuf[2]-0x30;
    }else{
      return(0);
    }
    if (find_key_val(str,strbuf,STR_BUFFER_SIZE,"a")){
      if (strbuf[0] == '1') {
        digitalWrite(relay2port[port],HIGH);// transistor on
        return(6);
      }
      else if (strbuf[0] == '0') {
        digitalWrite(relay2port[port],LOW);// transistor off
        return(6);
      }
    }
  } //fin "sw"
    return(-1);
}

uint16_t http200ok(void)
{
  uint16_t pl;
  pl= fill_tcp_data (buf, 0, "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n<h1>200 OK</h1>");
  return(pl);
}

// prepare the webpage by writing the data to the tcp send buffer
uint16_t print_webpage_entry(uint8_t *buf)
{
        uint16_t plen;
        plen=fill_tcp_data(buf,0,"HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nPragma: no-cache\r\n\r\n");
        plen=fill_tcp_data(buf,plen,"<p>Entry to Home site:<br>");
        plen=fill_tcp_data(buf,plen,"<form action=/confirm method=get>");
        plen=fill_tcp_data(buf,plen,"\nPassword: <input type=password size=10 name=pw><br>\n<input type=submit value=\"Home\"></form></p>");
        plen=fill_tcp_data(buf,plen,"<hr><br>version 1.0, pinguino.cc\n");
        return(plen);
}

// Home page - temperature & pressure measurements & access to IO view and control
uint16_t print_webpage(uint8_t *buf)
{
  char temp_string[10], pr_string[10];
  int i=0;

  uint16_t pl;

  getCurrentTemp(temp_string);
  getCurrentPr(pr_string);

  pl = fill_tcp_data (buf, 0, "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n");
  pl = fill_tcp_data (buf, pl, "<center><p><h1>Welcome to Pinguino Ethernet Interface (ENC28J60)</h1></p> ");

  pl = fill_tcp_data (buf, pl, "<hr><br><form METHOD=get action=\"");
  pl = fill_tcp_data (buf, pl, baseurl);
  pl = fill_tcp_data (buf, pl, "\">");
  pl = fill_tcp_data (buf, pl, "<h2> Current Temperature is </h2> ");
  pl = fill_tcp_data (buf, pl, "<h1><font color=\"#00FF00\"> ");

  while (temp_string[i]) {
    buf[TCP_CHECKSUM_L_P+3+pl]=temp_string[i++];
    pl++;
  }

  pl = fill_tcp_data (buf, pl, "  &#176C</font></h1><br> " );
  pl = fill_tcp_data (buf, pl, "<input type=hidden name=cmd value=1>");
  pl = fill_tcp_data (buf, pl, "<input type=submit value=\"Get Temperature\"></form>");

  pl = fill_tcp_data (buf, pl, "<hr><br><form METHOD=get action=\"");
  pl = fill_tcp_data (buf, pl, baseurl);
  pl = fill_tcp_data (buf, pl, "\">");
  pl = fill_tcp_data (buf, pl, "<h2> Current Pressure is </h2> ");
  pl = fill_tcp_data (buf, pl, "<h1><font color=\"#00FF00\"> ");

  i = 0;
  while (pr_string[i]) {
    buf[TCP_CHECKSUM_L_P+3+pl]=pr_string[i++];
    pl++;
  }

  pl = fill_tcp_data (buf, pl, "  hPa</font></h1><br> " );
  pl = fill_tcp_data (buf, pl, "<input type=hidden name=cmd value=2>");
  pl = fill_tcp_data (buf, pl, "<input type=submit value=\"Get Pressure\"></form>");

  pl = fill_tcp_data (buf, pl, "<hr><br><form METHOD=get action=\"");
  pl = fill_tcp_data (buf, pl, baseurl);

  pl = fill_tcp_data (buf, pl, "\">");
  pl = fill_tcp_data (buf, pl, "<input type=hidden name=cmd value=3>");
  pl = fill_tcp_data (buf, pl, "<input type=submit value=\"Get IO view & ctrl\"></form>");
  pl = fill_tcp_data (buf, pl, "</center><hr> <p> <a href=\"http://www.pinguino.cc\">www.pinguino.cc<a>");
  return(pl);
}
// IO server webpage
uint16_t print_webpage_io(void)
{
  uint16_t pl;
  char numstr[6];
  uint8_t switchnum=0;

  pl = fill_tcp_data (buf, 0, "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n");
  pl=fill_tcp_data(buf,pl,"<h2>");
  pl=fill_tcp_data(buf,pl,label);
  pl=fill_tcp_data(buf,pl,"</h2>\n<pre>");

  pl = fill_tcp_data (buf, pl, "<hr><br><form METHOD=get action=\"");
  pl = fill_tcp_data (buf, pl, baseurl); //
  pl = fill_tcp_data (buf, pl, "\">");
  pl = fill_tcp_data (buf, pl, "<input type=hidden name=cmd value=4>");
  pl = fill_tcp_data (buf, pl, "<input type=submit value=\"Refresh\"></form>");

  while(switchnum<MAX_RELAY){
    itoa(switchnum,strbuf,10); // convert integer to string
    pl=fill_tcp_data(buf,pl,"\nRD");
    pl=fill_tcp_data(buf,pl,strbuf); // switch number in ascii
    pl=fill_tcp_data(buf,pl," output: ");
    if (digitalRead(relay2port[switchnum])){
      pl=fill_tcp_data(buf,pl,"ON ");
    }else{
      pl=fill_tcp_data(buf,pl,"OFF");
    }
    pl=fill_tcp_data(buf,pl," [<a href=?sw=rd");
    pl=fill_tcp_data(buf,pl,strbuf); // switch number in ascii
    pl=fill_tcp_data(buf,pl,"&a=");
    if (digitalRead(relay2port[switchnum])){
      pl=fill_tcp_data(buf,pl,"0");
    }else{
      pl=fill_tcp_data(buf,pl,"1");
    }
    pl=fill_tcp_data(buf,pl,">change</a>]");
    pl=fill_tcp_data(buf,pl,"\n");
    switchnum++;
  }
  pl=fill_tcp_data(buf,pl,"\ndigital input RD4: ");
  if (digitalRead(d_input2port[0])){
    pl=fill_tcp_data(buf,pl,"1");
  }else{
    pl=fill_tcp_data(buf,pl,"0");
  }
  pl=fill_tcp_data(buf,pl,"\ndigital input RD5: ");
  if (digitalRead(d_input2port[1])){
    pl=fill_tcp_data(buf,pl,"1");
  }else{
    pl=fill_tcp_data(buf,pl,"0");
  }
  pl=fill_tcp_data(buf,pl,"\nanalog input ADC0: ");
  itoa(analogRead(A0),numstr,10); // convert integer to string
  pl=fill_tcp_data(buf,pl,numstr);
  pl=fill_tcp_data(buf,pl,"\nanalog input ADC1: ");
  itoa(analogRead(A1),numstr,10); // convert integer to string
  pl=fill_tcp_data(buf,pl,numstr);

  pl = fill_tcp_data (buf, pl, "<hr><br><form METHOD=get action=\"");
  pl = fill_tcp_data (buf, pl, baseurl); //
  pl = fill_tcp_data (buf, pl, "\">");
  pl = fill_tcp_data (buf, pl, "<input type=hidden name=cmd value=5>");
  pl = fill_tcp_data (buf, pl, "<input type=submit value=\"Home\"></form>");

  pl = fill_tcp_data (buf, pl, "</center><hr> <p> <a href=\"http://www.pinguino.cc\">www.pinguino.cc<a>");

  pl=fill_tcp_data(buf,pl,"</pre><hr>");
  return(pl);
}

void spint0() {
        if (stepcounter>1){
                stepcounter=0;
                digitalWrite(25,0);// transistor off
        }
        if (stepcounter>0){
                stepcounter++;
        }
}

// Generate an interrup about ever 1/2s form the 12.5MHz system clock
// Since we have that 1024 prescaler we do not really generate a second
// (1.00000256000655361677s)

void setup(){
  int8_t i;
  for (i=0; i < MAX_RELAY; i++)
  {
    pinMode(relay2port[i],OUTPUT);
    digitalWrite(relay2port[i],LOW);
  }
  for (i=0; i < MAX_D_INPUT; i++)
    pinMode(d_input2port[i],INPUT);
  Ethernet.init(mymac,myip,mywwwport); //eth_init
  OnTimer0(spint0, INT_MILLISEC, 500);
}

void loop(){
  uint16_t pl, dat_p;
  int8_t cmd;

  pl = Ethernet.read(BUFFER_SIZE, buf);//enc28j60PacketReceive
// pl will ne unequal to zero if there is a valid packet (without crc error)
  dat_p= Ethernet.requestAnalysis(buf,pl);//packetloop_icmp_tcp
  if(dat_p==0) return; // no http request

  if (strncmp("GET ",(char *)&(buf[dat_p]),4)!=0){
                                        // head, post and other methods:
                                        //
                                        // for possible status codes see:
                                        // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
    dat_p = http200ok();
    Ethernet.write(buf,dat_p); // send web page data
    return;
  }
  if (strncmp("/ ",(char *)&(buf[dat_p+4]),2)==0){
    dat_p=print_webpage_entry(buf);
    Ethernet.write(buf,dat_p); // send web page data
    return;
  }
  cmd=analyse_get_url((char *)&(buf[dat_p+5]));
                                // for possible status codes see:
                                // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

  if (cmd==-3){
    pl=fill_tcp_data(buf,0,"HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n<h1>Wrong password</h1>");
    dat_p=fill_tcp_data(buf,pl,"<a href=/>&gt;&gt;retry</a>\n");
    Ethernet.write(buf,dat_p); // send web page data
    return;
  }

  if (cmd==-1){
    dat_p=fill_tcp_data(buf,0,"HTTP/1.0 401 Unauthorized\r\nContent-Type: text/html\r\n\r\n<h1>401 Unauthorized</h1>");
    Ethernet.write(buf,dat_p); // send web page data
    return;
  }

  if (cmd==1 || cmd==2 || cmd==5){
    digitalWrite(25,1);// transistor on
    stepcounter=1; // trigger counter to clear transistor 1 sec later
    dat_p=print_webpage(buf);
    Ethernet.write(buf,dat_p); // send web page data
    return;
  }
  if (cmd==3) {
    dat_p = print_webpage_io();
    Ethernet.write(buf,dat_p); // send web page data
    return;
  }
  if (cmd == 4 || cmd == 6) {
  // just display the status:
    dat_p=print_webpage_io();
    Ethernet.write(buf,dat_p); // send web page data
    return;
  }

  if (cmd==10){
    Ethernet.write(buf,gPlen); // send web page data
    return;
  }

}
void getCurrentTemp (char *temp)
{
    TEMPERATURE t;

    if (DS18B20.read(ONEWIREBUS, SKIPROM, RES12BIT, &t))
    {
        if(t.sign) Sprintf(temp,"-%d.%d", t.integer, t.fraction);
  else Sprintf(temp,"%d.%d", t.integer, t.fraction);
    }
}

void getCurrentPr (char *pr)
{
int s;  // variable to store the value coming from the sensor
int ip; // rounded pressure (hPa)
float a0=1664; //ratio Vout/Vout pont diviseur experimental value
float a1=4095; // digital output for 3.21V = Valim uC measured with a multimeter
float a2=0.63817; //ratio Valim uC / Valim MPX4115AP 3.21V / 5.03V
float b=95, c=0.9;
float p;
  s = analogRead(A0);
  p = (a0 * a2 * s / a1 + b) / c;
  ip= (int) (p+0.5);

  Sprintf(pr,"%d", ip);
}
does not, errors:
Code:
[OUT] Compiling: C:/Users/user/untitled-2.pde
[OUT] Board: Pinguino 26J50
[OUT] Proc: 18f26j50
[OUT] Arch: 8
[OUT] Bootloader: v4
[DEBUG] Starting 'verify' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'preprocess' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'remove_comments' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'remove_comments': 0.00 s
[DEBUG] Ending 'remove_comments'
[DEBUG] Starting 'remove_comments' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'remove_comments': 0.00 s
[DEBUG] Ending 'remove_comments'
[DEBUG] Starting 'get_regobject_libinstructions' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'get_regobject_libinstructions': 0.00 s
[DEBUG] Ending 'get_regobject_libinstructions'
[DEBUG] Starting 'replace_word' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'replace_word': 0.35 s
[DEBUG] Ending 'replace_word'
[DEBUG] Time spent for 'preprocess': 0.40 s
[DEBUG] Ending 'preprocess'
[DEBUG] Starting 'compile' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'compile': 0.35 s
[DEBUG] Ending 'compile'
[DEBUG] Time spent for 'verify': 0.77 s
[DEBUG] Ending 'verify'
[OUT] ERROR: 20:  Duplicate symbol 'wwwport', symbol IGNORED
[OUT] 20:  previously defined here
[OUT] 23:  Duplicate symbol 'info_hdr_len', symbol IGNORED
[OUT] 23:  previously defined here
[OUT] 24:  Duplicate symbol 'info_data_len', symbol IGNORED
[OUT] 24:  previously defined here
[OUT] 25:  Duplicate symbol 'seqnum', symbol IGNORED
[OUT] 25:  previously defined here
[OUT] 50:  function 'checksum' already has body
[OUT] 91:  function 'init_ip_arp_udp_tcp' already has body
[OUT] 105:  function 'eth_type_is_arp_and_my_ip' already has body
[OUT] 124:  function 'eth_type_is_ip_and_my_ip' already has body
[OUT] 148:  function 'make_eth' already has body
[OUT] 161:  function 'make_eth_ip_new' already has body
[OUT] 177:  function 'fill_ip_hdr_checksum' already has body
[OUT] 191:  Duplicate symbol 'ip_identifier', symbol IGNORED
[OUT] 191:  previously defined here
[OUT] 197:  function 'make_ip_tcp_new' already has body
[OUT] 237:  function 'make_ip' already has body
[OUT] 248:  function 'step_seq' already has body
[OUT] 340:  function 'make_tcphead' already has body
[OUT] 366:  function 'make_arp_answer_from_request' already has body
[OUT] 15:  missing terminating > character
[OUT] 405:  function 'make_udp_reply_from_request' already has body
[OUT] 437:  function 'make_tcp_synack_from_syn' already has body
[OUT] 459:  function 'get_tcp_data_pointer' already has body
[OUT] 469:  function 'init_len_info' already has body
[OUT] 500:  function 'fill_tcp_data' already has body
[OUT] 548:  function 'make_tcp_ack_with_data_noflags' already has body
[OUT] 601:  function 'make_tcp_ack_from_any' already has body
[OUT] 645:  function 'www_server_reply' already has body
[OUT] 659:  function 'make_arp_request' already has body
[OUT] 714:  function 'arp_packet_is_myreply_arp' already has body
[OUT] 735:  function 'tcp_client_send_packet' already has body
[OUT] 829:  function 'tcp_get_dlength' already has body
[OUT] 846:  function 'packetloop_icmp_tcp' already has body
[OUT] 10:  function 'eth_init' already has body
[OUT]
>>>
something is still wrong, why it says that functions are redefined?
Reply
20-09-2015, 04:54 PM, (This post was last modified: 20-09-2015, 06:24 PM by B4lfiz4r.)
#4
RE: Where are older eleases?
I have tried to nail down what's wrong.
I am getting two errors in the simple test case:
"fill_tcp_data" bad number of arguments (for 3, 2, 1)
and
Code:
[OUT] ERROR: :\pinguino-11\user\source\main.asm:24:Error[113]   Symbol not previously defined: '_fill_tcp_data'

Where is that fill_tcp_data function defined? It seems missing for me. And the Pinguino IDE is wrong by telling me that the number of arguments is not correct while the function infact is not known at atll!

EDIT: okay, found it.... I also fixed the " function 'make_arp_request' already has body" errors by adding preprocessor guards in the C (yes, in the C!) files. That's insane... why would PINGUINO IDE try to include the same C file twice?! But it still does not compile.

Now I habe only this strange message:
[OUT] ERROR: 9: missing terminating > character
Code:
C:\pinguino-11\user\source\/define.h:8:30: error: missing terminating > character

I opened this file and it contains:
Code:
#define BUFFER_SIZE 500
#define ONEWIREBUS    6    
#define SPIINIT
#define STR_BUFFER_SIZE 22
#include <digitalp.c>
#include <digitalw.c>
#include <ethernet/ethernet.c
#include <ethernet/ethernet.c>
#include <typedef.h>

why? why is ">" missing?!

This file is machine-generated so I can't just fix it in the notepad....


No matter what I do, the define.h generated by pinguino_tools.py looks like thiss:
Code:
#define BUFFER_SIZE 500
#define ONEWIREBUS    6    
#define SPIINIT
#define STR_BUFFER_SIZE 22
#include <18b20.c>
#include <digitalp.c>
#include <digitalw.c>
#include <ethernet/ethernet.c
#include <ethernet/ethernet.c>
#include <stdio.c>
#include <string.h>
#include <typedef.h>
this is extremally silly, why would PINGUINO PREPROCESSOR want to include the ethernet.c TWICE and the first instance without the closing ">? ?!

There clearly MUST BE A BUG in pinguino_tools.py

I have worked around the issue by hacking the code to leave define.h alone so I can write it myself.
The current code is:
Code:
#!/usr/bin/env python
#  -*- coding: UTF-8 -*-

"""-------------------------------------------------------------------------
    pinguino

    (c) 2008-2009-2010-2011 Jean-Pierre MANDON <jp.mandon@gmail.com>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    -------------------------------------------------------------------------"""

import sys
import os
from subprocess import Popen, STDOUT
import re
import shutil
import time
import argparse
import logging

from .boards import boardlist as Boardlist
from .uploader.uploader import Uploader
from .tools import Debugger

HOME_DIR = os.path.split(os.path.dirname(os.path.realpath(__file__)))[0]


########################################################################
class PinguinoTools(object):

    #----------------------------------------------------------------------
    def __init__(self):
        # sys.stderr = debugger.Debugger("stderr")
        # sys.stdout = debugger.Debugger("stdout")
        # debugger.Debugger(sys)

        self.NoBoot = ("noboot", 0)
        self.Boot2 = ("boot2", 0x2000)
        self.Boot4 = ("boot4", 0x0C00)

        self.dict_boot = {"v2": self.Boot2,
                          "v4": self.Boot4,
                          "no": self.NoBoot,
                          }

        #self.P32_DIR = "p32"
        #self.P8_DIR = "p8"

    # RB 2015-01-27 : Still useful ? See also methods.py/set_board
    #----------------------------------------------------------------------
    def set_os_variables(self):

        #if sys.platform == 'darwin':
            #self.c8 = 'sdcc'
            #self.u32 = 'mphidflash'
            #self.make = 'make'

        if os.getenv("PINGUINO_OS_NAME") == "windows":
            self.COMPILER_8BIT = os.path.join(self.P8_BIN, "sdcc.exe")

            #self.p8 = 'picpgm.exe'
            #self.UPLOADER_32 = os.path.join(self.P32_BIN, "mphidflash.exe")

            # RB : 2014-11-14
            # Windows installer should download and install GnuWin32
            # and add path to the System Path, something like :
            # set PATH=%PATH%;C:\Program Files\GnuWin32\bin
            #self.MAKE = "make.exe"

            self.MAKE = os.path.join(self.P32_BIN, "make.exe")

        elif os.getenv("PINGUINO_OS_NAME") == "linux":
            self.COMPILER_8BIT = os.path.join(self.P8_BIN, "sdcc")
            #self.p8 = 'picpgm'
            #self.UPLOADER_32 = os.path.join(self.P32_BIN, "ubw32")
            #self.UPLOADER_32 = os.path.join(self.P32_BIN, "pic32prog")
            self.MAKE = "make"

        elif os.getenv("PINGUINO_OS_NAME") == "macosx":
            self.COMPILER_8BIT = os.path.join(self.P8_BIN, "sdcc")
            #self.p8 = 'picpgm'
            #self.UPLOADER_32 = os.path.join(self.P32_BIN, "mphidflash")
            self.MAKE = "make"


    #----------------------------------------------------------------------
    def set_board(self, board):

        self.__current_board__ = board
        #self.get_regobject_libinstructions(board.arch)


    #----------------------------------------------------------------------
    def get_board(self):

        return self.__current_board__


    #----------------------------------------------------------------------
    def get_filename(self):

        return self.__filename__


    #----------------------------------------------------------------------
    def get_hex_file(self):

        return self.__hex_file__


    #----------------------------------------------------------------------
    @Debugger.debug_method
    def verify(self, filename):

        DATA_RETURN = {}
        DATA_RETURN["compiling"] = {"c":[], "asm":[]}
        DATA_RETURN["linking"] = []
        DATA_RETURN["preprocess"] = []

        self.__filename__ = filename

        #self.in_verify=1
        t0 = time.time()

        filename = os.path.splitext(filename)[0]
        if os.path.exists(filename + ".hex"): os.remove(filename + ".hex")
        if os.path.exists(os.path.join(os.path.expanduser(self.SOURCE_DIR), "user.c")): os.remove(os.path.join(os.path.expanduser(self.SOURCE_DIR), "user.c"))

        cur_board = self.get_board()
        retour, error_preprocess = self.preprocess(filename)

        if not retour:
            DATA_RETURN["verified"] = False
            DATA_RETURN["preprocess"] = error_preprocess
            return DATA_RETURN


        # compilation
        if cur_board.arch == 8: MAIN_FILE="main.hex"
        else: MAIN_FILE="main32.hex"


        retour, error_compile = self.compile(filename)
        if retour != 0:
            DATA_RETURN["verified"] = False
            DATA_RETURN["compiling"] = error_compile
            return DATA_RETURN
            #self.displaymsg(_("error while compiling"),0)
            #self.displaymsg(_("check highlighted lines in your code"),0)
            #self.displaymsg(_("You can review the file stdout (F8) for more information."),0)
        else:
            retour, error_link = self.link(filename)
            if os.path.exists(os.path.join(os.path.expanduser(self.SOURCE_DIR), MAIN_FILE)) != True:
                DATA_RETURN["verified"] = False
                DATA_RETURN["linking"] = error_link
                #self.displaymsg(_("error while linking")+" "+filename+".o",0)
                #self.displaymsg(_("You can review the file stdout (F8) for more information."),0)
                return DATA_RETURN
            else:
                shutil.copy(os.path.join(os.path.expanduser(self.SOURCE_DIR), MAIN_FILE), filename+".hex")
                #self.displaymsg(_("Compilation done"),0)
                #self.displaymsg(self.__get_code_size__(filename, self.curBoard),0)
                #t = "%.1f" % ( time.time() - t0 )
                #self.displaymsg( t + " "+_("seconds process time"),0)
                os.remove(os.path.join(os.path.expanduser(self.SOURCE_DIR), MAIN_FILE))
                self.__hex_file__ = filename+".hex"

                DATA_RETURN["verified"] = True
                DATA_RETURN["time"] = "%.3f" % ( time.time() - t0 )
                DATA_RETURN["filename"] = self.get_filename()
                DATA_RETURN["hex_file"] = filename+".hex"
                DATA_RETURN["code_size"] = self.get_code_size()


                return DATA_RETURN


    #----------------------------------------------------------------------
    @Debugger.debug_method
    def __upload__(self):

        hex_file = self.get_hex_file()
        board = self.get_board()

        uploader = Uploader(hex_file, board)
        result = uploader.upload()

        """
        if board.arch == 8:
            uploader = Uploader(hex_file, board)
            result = uploader.write_hex()

        elif board.arch == 32:
            fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), 'stdout'), 'w+')

            #RB 19-06-2014 : pic32prog
            sortie=Popen([os.path.join(os.path.dirname(self.P32_BIN), self.UPLOADER_32),
                          "-w",
                          hex_file,
                          "-r",
                          "-n"],
                         stdout=fichier, stderr=STDOUT)

            #RB 19-06-2014 : ubw32/mhidflash
            sortie=Popen([os.path.join(os.path.dirname(self.P32_BIN), self.UPLOADER_32),
                          "-S", "-p", hex_file],
                         stdout=fichier, stderr=STDOUT)

            sortie.communicate()
            fichier.seek(0)
            result = fichier.readlines()
            fichier.close()
        """

        # Weed out blank lines with filter
        #result = filter(lambda line: not line.isspace(), result)
        #return result
        if result:
            return filter(lambda line: not line.isspace(), result)
        else:
            return []

    #----------------------------------------------------------------------
    @Debugger.debug_method
    def get_regobject_libinstructions(self, arch):
        """Return regobject and libinstructions for each architecture."""
        if arch == 8:
            if getattr(self, "libinstructions_8", False):
                return self.libinstructions_8
            else:
                self.libinstructions_8 = self.read_lib(8)
                return self.libinstructions_8

        elif arch == 32:
            if getattr(self, "libinstructions_32", False):
                return self.libinstructions_32
            else:
                self.libinstructions_32 = self.read_lib(32)
                return self.libinstructions_32


    #----------------------------------------------------------------------
    @Debugger.debug_method
    def read_lib(self, arch, include_default=True):
        """Load .pdl or .pdl32 files (keywords and libraries)
         trying to find PDL files to store reserved words."""

        regobject = []
        libinstructions = []

        all_pdls = self.USER_PDL

        if arch == 8:
            libext = ".pdl"
            libdir = self.P8_DIR
        else:
            libext = ".pdl32"
            libdir = self.P32_DIR

        if include_default:
            all_pdls.extend(map(lambda pdl:os.path.join(libdir, "pdl", pdl), os.listdir(os.path.join(libdir, "pdl"))))

        all_pdls = filter(lambda name:name.endswith(libext), all_pdls)


        for fichier in all_pdls:

            # check content of the PDL file
            lib_file = open(fichier, "r")
            lines = lib_file.readlines()
            lib_file.close()

            regex_pdl = "[\s]*([.\w]*)[\s]*([\w]*)[\s]*(#include[\w\s\.\<\>/]*)*(#define.*)*[\s]*"

            for line in lines:
                line = line[:line.find('//')]
                if line.isspace() or not line: continue

                reg = re.match(regex_pdl, line)
                instruction, cnvinstruction, include, define = reg.groups()
                include = "" if include is None else include
                define = "" if define is None else define
                cnvinstruction = instruction if cnvinstruction is "" else cnvinstruction

                if not instruction: continue

                # https://regex101.com/r/nH9nS9
                regex = re.compile(ur"([^.\w])(%s)([^.\w])"%re.escape(instruction), re.MULTILINE | re.DOTALL)

                libinstructions.append([instruction, cnvinstruction, include, define, regex])


        libinstructions.sort(lambda x,y: cmp(len(x[0]), len(y[0])))
        libinstructions.reverse()

        return libinstructions[:]


    #----------------------------------------------------------------------
    def remove_strings(self, content):

        strings = re.findall(r'"[^"]*"', content)
        content = re.sub(r'"[^"]*"', '"<PINGUINO_STRING>"', content)

        index = 0
        keys = {}
        for string in strings:
            content = content.replace('"<PINGUINO_STRING>"', '"<PINGUINO_STRING:%d>"' % index, 1)
            keys['"<PINGUINO_STRING:%d>"' % index] = string
            index += 1

        return content, keys


    #----------------------------------------------------------------------
    def recove_strings(self, content, keys):

        for key in keys.keys():
            content = content.replace(key, keys[key])
        return content


    #----------------------------------------------------------------------
    @Debugger.debug_method
    def preprocess(self, filename):
        """Read Pinguino File (.pde) and translate it into C language"""

        error = []
        #defineword = {}
        #index = 0

        # delete old define_hacked.h and create a new one
        if os.path.exists(os.path.join(os.path.expanduser(self.SOURCE_DIR), "define_hacked.h")):
            os.remove(os.path.join(os.path.expanduser(self.SOURCE_DIR), "define_hacked.h"))
        fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "define_hacked.h"), "a")
        fichier.close()

        # rename .pde in user.c
        #name = os.path.split(filename)[1]
        shutil.copy(filename + ".pde", os.path.join(os.path.expanduser(self.SOURCE_DIR), "user.c"))
        #fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "user.c"), "a")
        #fichier.close()


        fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "user.c"), "r")
        i=0
        defines = set()
        file_line = {}
        readlines = fichier.readlines()
        readlines = self.remove_comments(readlines)
        for line in readlines:
            if line.find("#include")!=-1 or line.find("#define")!=-1:
                line = line[:line.find('//')]   # Ignores C++ comments, fixing Issue 11
                defines.add(line+"\n")    # add to define_hacked.h
                file_line[i] = " \n"   # delete from user.c
                i += 1
            else:
                file_line[i] = line
                i += 1
        fichier.close()

        self.update_define(defines, mode="w")

        # rewrite file user.c without #include and #define
        fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "user.c"), "w")
        for cpt in range(i):
            fichier.write(file_line[cpt])
        fichier.close()

        # search and replace arduino keywords in file
        fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "user.c"), "r")
        content = fichier.read()
        content = self.remove_comments(content)
        content_nostrings, keys = self.remove_strings(content)
        #content = content.split('\n')
        nblines = 0
        libinstructions = self.get_regobject_libinstructions(self.get_board().arch)

        content_nostrings = self.replace_word(content_nostrings, libinstructions) + "\n"
        content = self.recove_strings(content_nostrings, keys)

        #for line in content:
            #if not line.isspace() and line:
                #resultline = self.replace_word(line, libinstructions) + "\n"
            #else: resultline = "\n"
            ##FIXME: error line
            ##if resultline.find("error") == 1:
                ###line = resultline
                ###print "error " + resultline
                ###self.displaymsg("error "+resultline,1)
                ##error.append(resultline)
                ##return False
            #file_line[nblines] = resultline
            #nblines += 1

        fichier.close()


        # save new tmp file
        fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "user.c"), "w")
        fichier.writelines(content)
        fichier.writelines("\r\n")
        fichier.close()
        #fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "user.c"), "w")
        #for i in range(0, nblines):
            #fichier.writelines(file_line[i])
        #fichier.writelines("\r\n")
        #fichier.close()

        # sort define_hacked.h
        fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "define_hacked.h"), "r")
        lignes = fichier.readlines()
        lignes.sort()
        fichier.close()

        # save sorted lines
        fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "define_hacked.h"), "w")
        fichier.writelines(lignes)
        fichier.close()

        return True, error


    #----------------------------------------------------------------------
    def update_define(self, defines, mode="a"):
        """"""
        fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "define_hacked.h"), mode)
        fichier.writelines(defines)
        fichier.close()


    #----------------------------------------------------------------------
    @Debugger.debug_method
    def replace_word(self, content, libinstructions=None):
        """ convert pinguino language in C language """

        if libinstructions is None:
            libinstructions = self.get_regobject_libinstructions(self.get_board().arch)

        defines = set()
        keys = {}
        index = 0

        # replace arduino/pinguino language and add #define or #include to define_hacked.h
        for instruction, cnvinstruction, include, define, regex in libinstructions:
            if re.search(regex, content):
                content = re.sub(regex, '\g<1><PINGUINO_RESERVED:%d>\g<3>' % index, content)  #safe

                keys['<PINGUINO_RESERVED:%d>' % index] = cnvinstruction
                index += 1

                defines.add(include+"\n")
                defines.add(define+" \n")


        content = self.recove_strings(content, keys)

        self.update_define(defines, mode="a")

        return content


    #----------------------------------------------------------------------
    @Debugger.debug_method
    def remove_comments(self, textinput):
        #FIXME: replace comment with white lines for debugger

        if type(textinput) == type([]):
            text = "".join(textinput)
        else:
            text = textinput

        def replacer(match):
            s = match.group(0)

            if s.startswith('/'):
                #return "" #bug in line number in error info, multiline comments
                return "" + "\n" * (s.count("\n"))

            else:
                return s

        pattern = re.compile(
            r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
            re.DOTALL | re.MULTILINE
        )
        textout = re.sub(pattern, replacer, text)

        if type(textinput) == type([]):
            textout = textout.split("\n")
            textout = map(lambda x:x+"\n", textout)

        return textout

    #----------------------------------------------------------------------
    def get_user_imports_p8(self):
        user_imports = []
        for lib_dir in self.USER_P8_LIBS:
            user_imports.append("-I" + lib_dir)
        return user_imports

    #----------------------------------------------------------------------
    def get_user_imports_p32(self):
        user_imports = []
        for lib_dir in self.USER_P32_LIBS:
            user_imports.append("-I" + lib_dir)
        return " ".join(user_imports)

    #----------------------------------------------------------------------
    @Debugger.debug_method
    def compile(self, filename):
        """ Compile.

        NB :    "--opt-code-size"   deprecated
                "--use-non-free"    implicit -I and -L options for non-free headers and libs
                "-I" + os.path.join(self.P8_DIR, '..', 'sdcc', 'include', 'pic16'),\
                "-I" + os.path.join(self.P8_DIR, '..', 'sdcc', 'non-free', 'include', 'pic16'),\
        """

        ERROR = {"c": {},
                 "asm": {},}

        board = self.get_board()

        if board.arch == 32: return 0, None

        fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "stdout"), "w+")

        user_imports = self.get_user_imports_p8()
        #for lib_dir in self.USER_P8_LIBS:
            #user_imports.append("-I" + lib_dir)

        if board.bldr == 'boot2':
            sortie = Popen([self.COMPILER_8BIT,
                "--verbose",\
                "-mpic16",\
                "--denable-peeps",\
                "--obanksel=9",\
                "--optimize-cmp",\
                "--optimize-df",\
                "-p" + board.proc,\
                "-D" + board.board,\
                "-D" + board.bldr,\
                "-DBOARD=\"" + board.board + "\"",\
                "-DPROC=\"" + board.proc + "\"",\
                "-DBOOT_VER=2",\
                "--use-non-free",\
                "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'core'),\
                "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'libraries'),\
                "-I" + os.path.dirname(filename),\
                "--compile-only",\
                "-o" + os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.o'),\
                os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.c')] + user_imports,\
                stdout=fichier, stderr=STDOUT)


        elif board.bldr == 'boot4':
            sortie = Popen([self.COMPILER_8BIT,
                "--verbose",\
                "-mpic16",\
                "--denable-peeps",\
                "--obanksel=9",\
                "--optimize-cmp",\
                "--optimize-df",\
                # Do not remove --ivt-loc option
                "--ivt-loc=" + str(board.memstart),\
                "-p" + board.proc,\
                "-D" + board.board,\
                "-D" + board.bldr,\
                "-DBOARD=\"" + board.board + "\"",\
                "-DPROC=\"" + board.proc + "\"",\
                "-DBOOT_VER=4",\
                "--use-non-free",\
                "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'core'),\
                "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'libraries'),\
                "-I" + os.path.dirname(filename),\
                "--compile-only",\
                os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.c'),\
                "-o" + os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.o')] + user_imports,\
                stdout=fichier, stderr=STDOUT)

        elif board.bldr == 'noboot':
            sortie = Popen([self.COMPILER_8BIT,
                "--verbose",\
                "-mpic16",\
                "--denable-peeps",\
                "--obanksel=9",\
                "--optimize-cmp",\
                "--optimize-df",\
                "-p" + board.proc,\
                "-D" + board.board,\
                "-D" + board.bldr,\
                "-DBOARD=\"" + board.board + "\"",\
                "-DPROC=\"" + board.proc + "\"",\
                "-DBOOT_VER=0",\
                "--use-non-free",\
                "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'core'),\
                "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'libraries'),\
                "-I" + os.path.dirname(filename),\
                "--compile-only",\
                os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.c'),\
                "-o" + os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.o')] + user_imports,\
                stdout=fichier, stderr=STDOUT)


        sortie.communicate()
        if sortie.poll()!=0:
            #
            # Error treatment (RB: fixed 2012-11-15)
            #

            # set the file pointer to the beginning of stdout
            fichier.seek(0)

            # read lines until 'error' or 'Error' is found
            lines = fichier.readlines()
            errors_c = []
            errors_asm = []
            for ligne in lines:
                # C errors
                error_pos = ligne.find('error')
                if (error_pos != -1):
                    if os.name == "nt": err = 2
                    else: err = 1
                    error_line_number = ligne.split(":")[err]
                    error_message = ligne.split(":")[-1]
                    if error_line_number.isdigit():
                        errors_c.append({"line_number": error_line_number,
                                         "message": error_message,})

                # ASM errors
                error_pos = ligne.find('Error')
                if (error_pos != -1):
                    # do not display error line number since they are from the ASM file
                    # display error symbol instead
                    error_symbol = ligne[ligne.find("(_") + 2 : ligne.find(").")]
                    error_message = ligne[ error_pos + 13 : ligne.find("(_") - 1]
                    errors_asm.append(error_symbol)

            ERROR["c"] = errors_c
            ERROR["asm"] = errors_asm

        fichier.close()
        return sortie.poll(), ERROR


    # ------------------------------------------------------------------------------
    def report(self, message):
        #import sys
        #reload(sys)
        #sys.stdout.write("DEBUG : " + message + "\r\n")
        logging.info(message)

    #----------------------------------------------------------------------
    @Debugger.debug_method
    def link(self, filename):
        """Link.

        NB :  "--opt-code-size"   deprecated
              "--use-non-free"    implicit -I and -L options for non-free headers and libs
                    "-I" + os.path.join(self.P8_DIR, 'sdcc', 'include', 'pic16'),\
                    "-I" + os.path.join(self.P8_DIR, 'sdcc', 'non-free', 'include', 'pic16'),\
                    "-I" + os.path.join(self.P8_DIR, 'pinguino', 'core'),\
                    "-I" + os.path.join(self.P8_DIR, 'pinguino', 'libraries'),\
                    "-L" + os.path.join(self.P8_DIR, 'sdcc', 'lib', 'pic16'),\
                    "-L" + os.path.join(self.P8_DIR, 'sdcc', 'non-free', 'lib', 'pic16'),\
        """

        error = []
        board = self.get_board()
        fichier = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "stdout"), "w+")

        user_imports = self.get_user_imports_p8()
        #for lib_dir in self.USER_P8_LIBS:
            #user_imports.append("-I" + lib_dir)

        if board.arch == 8:

            if board.bldr == 'boot2':
                sortie = Popen([self.COMPILER_8BIT,
                    "--verbose",\
                    "-mpic16",\
                    "--denable-peeps",\
                    "--obanksel=9",\
                    "--optimize-cmp",\
                    "--optimize-df",\
                    "--no-crt",\
                    "-Wl-s" + os.path.join(self.P8_DIR, 'lkr', board.bldr + '.' + board.proc + '.lkr') + ",-m",\
                    "-p" + board.proc,\
                    "-D" + board.bldr,\
                    "-D" + board.board,\
                    "-DBOARD=\"" + board.board + "\"",\
                    "-DPROC=\"" + board.proc + "\"",\
                    "-DBOOT_VER=2",\
                    "--use-non-free",\
                    "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'core'),\
                    "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'libraries'),\
                    'libio' + board.proc + '.lib',\
                    'libdev' + board.proc + '.lib',\
                    'libc18f.lib',\
                    'libm18f.lib',\
                    'libsdcc.lib',\
                    "-o" + os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.hex'),\
                    os.path.join(self.P8_DIR, 'obj', 'application_iface.o'),\
                    os.path.join(self.P8_DIR, 'obj', 'boot_iface.o'),\
                    os.path.join(self.P8_DIR, 'obj', 'usb_descriptors.o'),\
                    os.path.join(self.P8_DIR, 'obj', 'crt0ipinguino.o'),\
                    os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.o')] + user_imports,\
                    stdout=fichier, stderr=STDOUT)

            elif board.bldr == 'boot4':
                sortie = Popen([self.COMPILER_8BIT,
                    "--verbose", "-V",\
                    "-mpic16",\
                    # optimization
                    "--denable-peeps",\
                    "--obanksel=9",\
                    "--optimize-cmp",\
                    "--optimize-df",\
                    # don't want to link default crt0i.o but crt0i.c
                    "--no-crt",\
                    # move all int. vectors after bootloader code
                    "--ivt-loc=" + str(board.memstart),\
                    # link memory map
                    "-Wl-s" + os.path.join(self.P8_DIR, 'lkr', board.bldr + '.' + board.proc + '.lkr') + ",-m",\
                    "-p" + board.proc,\
                    "-D" + board.bldr,\
                    "-D" + board.board,\
                    "-DBOARD=\"" + board.board + "\"",\
                    "-DPROC=\"" + board.proc + "\"",\
                    "-DBOOT_VER=4",\
                    "--use-non-free",\
                    "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'core'),\
                    "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'libraries'),\
                    os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.o'),\
                    'libio' + board.proc + '.lib',\
                    'libdev' + board.proc + '.lib',\
                    'libc18f.lib',\
                    'libm18f.lib',\
                    # link the default run-time module (crt0i.o)
                    # except when "-no-crt" option is used
                    'libsdcc.lib',\
                    "-o" + os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.hex'),\
                    ] + user_imports,\
                    stdout=fichier, stderr=STDOUT)

            elif board.bldr == 'noboot':
                sortie = Popen([self.COMPILER_8BIT,
                    "--verbose",\
                    "-mpic16",\
                    "--denable-peeps",\
                    "--obanksel=9",\
                    "--optimize-cmp",\
                    "--optimize-df",\
                    #"--no-crt",\ we use default run-time module inside libsdcc.lib
                    "-Wl-s" + os.path.join(self.P8_DIR, 'lkr', board.proc + '_g.lkr') + ",-m",\
                    "-p" + board.proc,\
                    "-D" + board.bldr,\
                    "-D" + board.board,\
                    "-DBOARD=\"" + board.board + "\"",\
                    "-DPROC=\"" + board.proc + "\"",\
                    "-DBOOT_VER=0",\
                    "--use-non-free",\
                    "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'core'),\
                    "-I" + os.path.join(self.P8_DIR, 'include', 'pinguino', 'libraries'),\
                    'libio' + board.proc + '.lib',\
                    'libdev' + board.proc + '.lib',\
                    'libc18f.lib',\
                    'libm18f.lib',\
                    # link the default run-time module
                    'libsdcc.lib',\
                    "-o" + os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.hex'),\
                    os.path.join(os.path.expanduser(self.SOURCE_DIR), 'main.o')] + user_imports,\
                    stdout=fichier, stderr=STDOUT)

        else:#if board.arch == 32:

            makefile = os.path.join(os.path.expanduser(self.SOURCE_DIR), 'Makefile32.'+os.getenv("PINGUINO_OS_NAME"))

            user_imports32 = self.get_user_imports_p32()

            if user_imports32: _IDE_USERLIBS_ = ["_IDE_USERLIBS_=" + user_imports32]
            else: _IDE_USERLIBS_ = []

            #self.report(makefile)

            sortie = Popen([self.MAKE,
                            "--makefile=" + makefile,
                            "_IDE_PDEDIR_=" + os.path.dirname(filename),
                            "_IDE_PROC_=" + board.proc,
                            "_IDE_BOARD_=" + board.board,
                            "_IDE_BINDIR_=" + self.P32_BIN,  #default /usr/bin
                            "_IDE_P32DIR_=" + self.P32_DIR,  #default /usr/share/pinguino-11.0/p32
                            "_IDE_SRCDIR_=" + self.SOURCE_DIR,
                            "_IDE_USERHOMEDIR_=" + os.getenv("PINGUINO_USER_PATH"),  #default ~/.pinguino
                            "_IDE_OSARCH_=" + os.getenv("PINGUINO_OS_ARCH"),
                            "_IDE_HEAP_SIZE_=" + self.HEAPSIZE,
                            "_IDE_MIPS16_ENABLE_=" + self.MIPS16,
                            "_IDE_OPTIMIZATION_=" + self.OPTIMIZATION,

                         ] + _IDE_USERLIBS_,

                         stdout=fichier, stderr=STDOUT)

        sortie.communicate()

        fichier.seek(0)
        # Check if child process has terminated
        if sortie.poll() != 0:
            for ligne in fichier:
                if ligne.find("error") != -1:
                    error.append(ligne)
        fichier.close()

        if sys.platform == "win32":

            if board.board in ["PIC32_PINGUINO_220", "Pinguino32MX220", "Pinguino32MX250", "Pinguino32MX270"]:
                badrecord = ":040000059D0040001A\n"
            else:
                badrecord = ":040000059D006000FA\n"

            if os.path.exists(os.path.join(os.path.expanduser(self.SOURCE_DIR), "main32tmp.hex")):
                fichiersource = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "main32tmp.hex"), "r")
                fichierdest = open(os.path.join(os.path.expanduser(self.SOURCE_DIR), "main32.hex"), "w+")
                for line in fichiersource:
                    if line != badrecord:
                        fichierdest.writelines(line)
                fichiersource.close()
                fichierdest.close()
                os.remove(os.path.join(os.path.expanduser(self.SOURCE_DIR), "main32tmp.hex"))

        return sortie.poll(), error


    #----------------------------------------------------------------------
    def get_code_size(self):

        board = self.get_board()
        filename = self.get_hex_file()

        codesize = 0
        address_Hi = 0

        memfree = board.memend - board.memstart

        #print "%X" % board.memstart
        #print "%X" % board.memend

        fichier = open(filename, 'r')
        lines = fichier.readlines()

        for line in lines:

            byte_count = int(line[1:3], 16)
            address_Lo = int(line[3:7], 16)
            record_type= int(line[7:9], 16)

            # extended linear address record
            if record_type == 4:
                address_Hi = int(line[9:13], 16) << 16

            # code size
            if record_type == 0:

                # address calculation
                address = address_Hi + address_Lo
                #self.displaymsg(_("address = %X" % address),0)

                if (address >= board.memstart) and (address < board.memend):
                    codesize = codesize + byte_count

        fichier.close()
        return "Code size: " + str(codesize) + " / " + str(memfree) + " " + "bytes" + " (" + str(100*codesize/memfree) + "% " + "used"+ ")"


# ------------------------------------------------------------------------------
# getOptions
# ------------------------------------------------------------------------------
def getOptions():
    parser = argparse.ArgumentParser(description='*** Pinguino IDE ***')
    parser.add_argument('-v', '--version', dest='version', action='store_true', default=False, help='show Pinguino IDE version and exit')
    parser.add_argument('-a', '--author', dest='author', action='store_true', default=False, help='show authors of this Pinguino IDE version and exit')
    parser.add_argument('-f', '--filename', dest='filename', nargs=1, default=False, help='filename to process')
    parser.add_argument('-dv', '--dev', dest='dev', nargs=1, default=False, help='set developer mode')
    parser.add_argument('-ul', '--upload', dest='upload', const=True, action='store_const', default=False, help='upload code')
    parser.add_argument('-bt', '--boot', dest='bootloader', nargs=1, default=False, help='set bootloader option')

    for b in range(len(Boardlist)):
        parser.add_argument(    Boardlist[b].shortarg,
                                Boardlist[b].longarg,
                                dest='board',
                                const=b,
                                action='store_const',
                                default=False,
                                help='compile code for ' + Boardlist[b].board + ' board')
    return parser.parse_args()

the ethernet_web_temp.pde finally compiles!...
Reply
20-09-2015, 08:00 PM,
#5
RE: Where are older eleases?
I successfully compiled the preceding pde which is my example ethernet_io_server.pde with both 47j53 and 26j50.
For this I have reinstalled the Pinguino IDE and solely changed spi.c and spi.h with mine.
Are you sure you use the last revision for both IDE and library P8 ? From what site do you install or update ?
A long time ago (summer 2014) I noticed this same duplication for an #include it was really a bug with the IDE. But this was quickly repaired.
I successfully compiled ethernet_web_temp.pde. Here is the define.h :
#define ANALOGREAD


#define BUFFER_SIZE 500

#define ONEWIREBUS 6

#define SPIINIT

#define STR_BUFFER_SIZE 22

#include <18b20.c>

#include <analog.c>

#include <digitalp.c>

#include <digitalw.c>

#include <ethernet/ethernet.c>

#include <stdio.c>

#include <string.h>

#include <typedef.h>

Therefore no duplication

 Would you reinstall the IDE and P8 library to know if the problem happens yet.

Bye
Reply
20-09-2015, 09:51 PM,
#6
RE: Where are older eleases?
I have reinstalled it today. The installer used is pinguino-11.2015.02.02-setup.exe
I will try again on a fresh computer just to be sure...
What PINGUINO IDE version are you using right now?
Reply
20-09-2015, 10:13 PM,
#7
RE: Where are older eleases?
(20-09-2015, 09:51 PM)B4lfiz4r Wrote: I have reinstalled it today. The installer used is pinguino-11.2015.02.02-setup.exe
I will try again on a fresh computer just to be sure...
What PINGUINO IDE version are you using right now?

I work with Windows 10. The beginning of my installation was done with the installer pinguino-11.2015.02.02-setup.exe. In fact the installer doesnot work upto the end with Windows 10. I had to terminate manually for the libraries which I took in github.com/PinguinoIDE. I shall retry from SourceForge.
Reply
20-09-2015, 10:37 PM, (This post was last modified: 20-09-2015, 10:37 PM by B4lfiz4r.)
#8
RE: Where are older eleases?
I have installed this latest version on clear windows xp machine and replaced SPI files. It does not compile.
Error log:
Code:
[OUT] Compiling: C:\pinguino-11\user\examples.Communication\Ethernet\ethernet_web_temp.pde
[OUT] Board: Pinguino 26J50
[OUT] Proc: 18f26j50
[OUT] Arch: 8
[OUT] Bootloader: v4
[DEBUG] Starting 'verify' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'preprocess' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'remove_comments' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'remove_comments': 0.00 s
[DEBUG] Ending 'remove_comments'
[DEBUG] Starting 'remove_comments' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'remove_comments': 0.00 s
[DEBUG] Ending 'remove_comments'
[DEBUG] Starting 'get_regobject_libinstructions' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'get_regobject_libinstructions': 0.00 s
[DEBUG] Ending 'get_regobject_libinstructions'
[DEBUG] Starting 'replace_word' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'replace_word': 0.22 s
[DEBUG] Ending 'replace_word'
[DEBUG] Time spent for 'preprocess': 0.25 s
[DEBUG] Ending 'preprocess'
[DEBUG] Starting 'compile' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'compile': 0.78 s
[DEBUG] Ending 'compile'
[DEBUG] Time spent for 'verify': 1.06 s
[DEBUG] Ending 'verify'
[OUT] ERROR: 20:  Duplicate symbol 'wwwport', symbol IGNORED
[OUT] 20:  previously defined here
[OUT] 23:  Duplicate symbol 'info_hdr_len', symbol IGNORED
[OUT] 23:  previously defined here
[OUT] 24:  Duplicate symbol 'info_data_len', symbol IGNORED
[OUT] 24:  previously defined here
[OUT] 25:  Duplicate symbol 'seqnum', symbol IGNORED
[OUT] 25:  previously defined here
[OUT] 50:  function 'checksum' already has body
[OUT] 91:  function 'init_ip_arp_udp_tcp' already has body
[OUT] 105:  function 'eth_type_is_arp_and_my_ip' already has body
[OUT] 124:  function 'eth_type_is_ip_and_my_ip' already has body
[OUT] 148:  function 'make_eth' already has body
[OUT] 161:  function 'make_eth_ip_new' already has body
[OUT] 177:  function 'fill_ip_hdr_checksum' already has body
[OUT] 191:  Duplicate symbol 'ip_identifier', symbol IGNORED
[OUT] 191:  previously defined here
[OUT] 197:  function 'make_ip_tcp_new' already has body
[OUT] 237:
[OUT] 9:  missing terminating > character
[OUT] 248:  function 'step_seq' already has body
[OUT] 340:  function 'make_tcphead' already has body
[OUT] 366:  function 'make_arp_answer_from_request' already has body
[OUT] 389:  function 'make_echo_reply_from_request' already has body
[OUT] 405:  function 'make_udp_reply_from_request' already has body
[OUT] 437:  function 'make_tcp_synack_from_syn' already has body
[OUT] 459:  function 'get_tcp_data_pointer' already has body
[OUT] 469:  function 'init_len_info' already has body
[OUT] 500:  function 'fill_tcp_data' already has body
[OUT] 548:  function 'make_tcp_ack_with_data_noflags' already has body
[OUT] 601:  function 'make_tcp_ack_from_any' already has body
[OUT] 645:  function 'www_server_reply' already has body
[OUT] 659:  function 'make_arp_request' already has body
[OUT] 714:  function 'arp_packet_is_myreply_arp' already has body
[OUT] 735:  function 'tcp_client_send_packet' already has body
[OUT] 829:  function 'tcp_get_dlength' already has body
[OUT] 846:  function 'packetloop_icmp_tcp' already has body
[OUT] 10:  function 'eth_init' already has body
[OUT]
>>>
STDOUT:
Code:
/dvpt/pinguino/git-copy/pinguino-compilers/sources/sdcc/src/pic16/main.c:701 setting interrupt vector addresses 0xc00
C:/pinguino-11/p8/include/pinguino/libraries/18b20.c:555: warning 85: in function DS18B20StartMeasure unreferenced local variable : 'temp_lsb'
C:/pinguino-11/p8/include/pinguino/libraries/18b20.c:555: warning 85: in function DS18B20StartMeasure unreferenced local variable : 'temp_msb'
C:/pinguino-11/p8/include/pinguino/libraries/18b20.c:555: warning 85: in function DS18B20StartMeasure unreferenced local variable : 'temp'
C:/pinguino-11/p8/include/pinguino/libraries/18b20.c:628: warning 85: in function DS18B20ReadMeasure unreferenced local variable : 'res'
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/enc28j60p.c:183: warning 116: right shifting more than size of object changed to zero
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/enc28j60p.c:186: warning 116: right shifting more than size of object changed to zero
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/enc28j60p.c:188: warning 158: overflow in implicit constant conversion
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/enc28j60p.c:191: warning 158: overflow in implicit constant conversion
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/enc28j60p.c:260: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/enc28j60p.c:277: warning 158: overflow in implicit constant conversion
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/enc28j60p.c:349: warning 94: comparison is always false due to limited range of data type
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/enc28j60p.c:351: warning 158: overflow in implicit constant conversion
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:20: error 0: Duplicate symbol 'wwwport', symbol IGNORED
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:20: error 177: previously defined here
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:23: error 0: Duplicate symbol 'info_hdr_len', symbol IGNORED
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:23: error 177: previously defined here
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:24: error 0: Duplicate symbol 'info_data_len', symbol IGNORED
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:24: error 177: previously defined here
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:25: error 0: Duplicate symbol 'seqnum', symbol IGNORED
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:25: error 177: previously defined here
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:50: error 65: function 'checksum' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:91: error 65: function 'init_ip_arp_udp_tcp' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:105: error 65: function 'eth_type_is_arp_and_my_ip' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:124: error 65: function 'eth_type_is_ip_and_my_ip' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:148: error 65: function 'make_eth' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:161: error 65: function 'make_eth_ip_new' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:177: error 65: function 'fill_ip_hdr_checksum' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:191: error 0: Duplicate symbol 'ip_identifier', symbol IGNORED
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:191: error 177: previously defined here
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:197: error 65: function 'make_ip_tcp_new' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:237: error In file included from C:\pinguino-11\user\source\main.c:56:
C:\pinguino-11\user\source\/define.h:9:30: error: missing terminating > character
Processor: 18f26j50
sdcc: Calling preprocessor...
sdcc: sdcpp.exe -nostdinc -Wall -D"PINGUINO26J50" -D"boot4" -D"BOARD=\"PINGUINO26J50\"" -D"PROC=\"18f26j50\"" -D"BOOT_VER=4" -I"C:\pinguino-11\p8\include\pinguino\core" -I"C:\pinguino-11\p8\include\pinguino\libraries" -I"C:\pinguino-11\user\examples\04.Communication\Ethernet" -D__18f26j50 -D__SDCC_PIC18F26J50 -D__STACK_MODEL_SMALL -obj-ext=.o -D__SDCC_USE_NON_FREE -D__SDCC_ALL_CALLEE_SAVES -D__SDCC=3_5_0 -D__SDCC_REVISION=9248 -D__SDCC_pic16 -D__STDC_NO_COMPLEX__ -D__STDC_NO_THREADS__ -D__STDC_NO_ATOMICS__ -D__STDC_NO_VLA__ -isystem "C:\pinguino-11\compilers\p8\bin\..\share\sdcc\include\pic16" -isystem "C:\pinguino-11\compilers\p8\bin\..\share\sdcc\include" -isystem "C:\pinguino-11\compilers\p8\bin\..\share\sdcc\non-free\include\pic16" -isystem "C:\pinguino-11\compilers\p8\bin\..\share\sdcc\non-free\include"  "C:\pinguino-11\user\source\main.c"
sdcc: Generating code...
65: function 'make_ip' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:248: error 65: function 'step_seq' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:340: error 65: function 'make_tcphead' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:366: error 65: function 'make_arp_answer_from_request' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:389: error 65: function 'make_echo_reply_from_request' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:405: error 65: function 'make_udp_reply_from_request' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:437: error 65: function 'make_tcp_synack_from_syn' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:459: error 65: function 'get_tcp_data_pointer' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:469: error 65: function 'init_len_info' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:500: error 65: function 'fill_tcp_data' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:548: error 65: function 'make_tcp_ack_with_data_noflags' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:601: error 65: function 'make_tcp_ack_from_any' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:645: error 65: function 'www_server_reply' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:659: error 65: function 'make_arp_request' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:714: error 65: function 'arp_packet_is_myreply_arp' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:735: error 65: function 'tcp_client_send_packet' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:829: error 65: function 'tcp_get_dlength' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ip_arp_udp_tcp.c:846: error 65: function 'packetloop_icmp_tcp' already has body
C:/pinguino-11/p8/include/pinguino/libraries/ethernet/ethernet.c:10: error 65: function 'eth_init' already has body
C:/pinguino-11/p8/include/pinguino/core/stdio.c:171: warning 85: in function pprinti unreferenced function argument : 'separator'
C:/pinguino-11/p8/include/pinguino/core/stdio.c:331: warning 85: in function pprintfl unreferenced function argument : 'separator'

auto-generated define.h (by python code)
Code:
#define BUFFER_SIZE 500
#define ONEWIREBUS    6    
#define SPIINIT
#define STR_BUFFER_SIZE 22
#include <18b20.c>
#include <digitalp.c>
#include <digitalw.c>
#include <ethernet/ethernet.c
#include <ethernet/ethernet.c>
#include <stdio.c>
#include <string.h>
#include <typedef.h>

Something is very, very wrong. The ">" is missing and the ethernet.c is included twice.
Reply
21-09-2015, 01:33 PM, (This post was last modified: 21-09-2015, 01:34 PM by gtcbreizh.)
#9
RE: Where are older eleases?
I noticed the package pinguino-ide.zip (26-6-2015) from SourceForge when I unzip and put it to replace the IDE installed yesterday by pinguino-11.2015.02.02-setup.exe give me the same error as you when I compile ethernet_web_temp.pde :
#include <ethernet/ethernet.c

#include <ethernet/ethernet.c>



Therefore pinguino-11.2015.02.02-setup.exe give different results according the PC system. It seems to me that pinguino-11.2015.02.02-setup.exe uploaded pinguino-ide 26-6-2015 on your system and another ide on my system. I ask myself where is this another IDE (what site and page ?), In any case it seems newer than 26-6-2015.


Your installation on a fresh Windows Xp system yesterday night does reinforce me in this idea.


Bye
Reply
21-09-2015, 04:54 PM,
#10
RE: Where are older eleases?
(21-09-2015, 01:33 PM)gtcbreizh Wrote: Therefore pinguino-11.2015.02.02-setup.exe give different results according the PC system.

Are you sure? Well, I might saw that this installer is downloaded something, but I can't say its giving different results.
For myself, I always had the same version installed with the same preprocessor error.
Can you (or somebody else) do more tests to check this issue?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)