Robotonics / pinguino32

Automatically exported from code.google.com/p/pinguino32
0 stars 0 forks source link

p8 i2cslave.c fix #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. calling I2C.onRequest;I2C.onReceive;Wire.onRequest;Wire.onReceive
2. including i2cslave.c

What is the expected output? What do you see instead?
1. gpasm.exe has stopped working
2. the following are the main errors
C:\x4-easy-rev857\source\main.asm:2591:Error[154]   Each object file section 
must be contiguous (section 
S_C__Users_Jackie_Desktop_x4_easy_rev857_source_main__i2c_call_process_message)

C:\x4-easy-rev857\source\main.asm:2591:Error[116]   Address label duplicated or 
different in second pass (_i2c_call_process_message)

C:\x4-easy-rev857\source\main.asm:2619:Error[116]   Address label duplicated or 
different in second pass (_00838_DS_)

C:\x4-easy-rev857\source\main.asm:2630:Error[116]   Address label duplicated or 
different in second pass (_00833_DS_)

What version of the product are you using? On what operating system?
IDE version : x4-easy-rev857
OS          : window 7
Architecture:8-bit

Please provide any additional information below.
The error had been fixed by editing i2cslave.c
Changes made are removing i2c_call_process_message() function prototype and 
replacing the line with its content where it is executed.

//void i2c_call_process_message()
//{
//   // let user process buffer
//   if (i2c_datapresent)
//   {
//      _i2c_rxBufferIndex=0;
//      _i2c_onReceive_function(_i2c_rxBufferLength);  
//      i2c_datapresent = 0;
//      _i2c_rxBufferLength = 0;
//      _i2c_rxBufferIndex=0;
//  }
//
//}

void i2c_hw_slave_on_stop()
{   // let user process buffer
   if (i2c_datapresent)
   {
      _i2c_rxBufferIndex=0;
      _i2c_onReceive_function(_i2c_rxBufferLength);  
      i2c_datapresent = 0;
      _i2c_rxBufferLength = 0;
      _i2c_rxBufferIndex=0;
  }
}

void i2c_hw_slave_on_state_1(u8 _trash)
{
   // let user process buffer (there should not be one if the proper procedure is executed)
   if (i2c_datapresent)
   {
      _i2c_rxBufferIndex=0;
      _i2c_onReceive_function(_i2c_rxBufferLength);  
      i2c_datapresent = 0;
      _i2c_rxBufferLength = 0;
      _i2c_rxBufferIndex=0;
  }
}

The file attached is the edited i2cslave.c

Original issue reported on code.google.com by jacky03...@gmail.com on 18 Jun 2013 at 4:53

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry for my poor english.
Changes made are removing i2c_call_process_message() function prototype and 
replacing the line where it is executed with its content.

Original comment by jacky03...@gmail.com on 18 Jun 2013 at 4:55

GoogleCodeExporter commented 9 years ago

Original comment by rblanchot@gmail.com on 31 Aug 2013 at 9:53

GoogleCodeExporter commented 9 years ago

Original comment by rblanchot@gmail.com on 31 Aug 2013 at 3:26