[Avr-list] aversive CVS_LOG 2009-04-26

2009-04-25 Par sujet root
Commit from zer0 on branch b_zer0 (2009-04-25 11:06 CEST)
=

Add baudrate and signature check in config for avrdude.
Signed-off: Antoine albertelli antoinea...@gmail.com

  aversive  config/generate_aversive_config  1.23.4.16
  aversive  config/config.in 1.42.4.29
  aversive  config/Configure.help1.13.4.19



aversive/config/generate_aversive_config  (1.23.4.15 - 1.23.4.16)


@@ -141,6 +141,16 @@
 echo -n AVRDUDE_PORT =   $2
 echo `grep CONFIG_AVRDUDE_PORT $1 | sed s,CONFIG_AVRDUDE_PORT=,,`  $2
 
+echo -n AVRDUDE_BAUDRATE =   $2
+echo `grep CONFIG_AVRDUDE_BAUDRATE $1 | sed s,CONFIG_AVRDUDE_BAUDRATE=,,`  
$2
+
+if grep CONFIG_AVRDUDE_CHECK_SIGNATURE=y $1  /dev/null 2 /dev/null
+then
+echo AVRDUDE_FLAGS_SIGNATURE_CHECK =  $2
+else
+echo AVRDUDE_FLAGS_SIGNATURE_CHECK = -F  $2
+fi
+
 
 if grep CONFIG_AVARICE=y $1  /dev/null 2 /dev/null
 then


=
aversive/config/config.in  (1.42.4.28 - 1.42.4.29)
=

@@ -519,6 +519,8 @@
 
 string 'Port device' CONFIG_AVRDUDE_PORT '/dev/parport0'
 
+int 'Programmer baudrate' CONFIG_AVRDUDE_BAUDRATE '19200'
+
 endmenu
 
 mainmenu_option next_comment
@@ -534,6 +536,7 @@
 
 endmenu
 
+bool 'Check device signature' CONFIG_AVRDUDE_CHECK_SIGNATURE
 
 endmenu
 


==
aversive/config/Configure.help  (1.13.4.18 - 1.13.4.19)
==

@@ -350,6 +350,15 @@
   '/dev/ttyS0', depending on the programmer type. Under win32, it can
   look like 'com1' for instance.
 
+CONFIG_AVRDUDE_BAUDRATE
+  Choose the baudrate. This can be very useful if you are using a stk500
+  bootloader, and you want to speed it up.
+
+CONFIG_AVRDUDE_CHECK_SIGNATURE
+  Avrdude normally checks the device signature, but some bootloaders doesn't
+  implement this, or your device may not communicate with Avrdude. This option
+  allows you to bypass this check.
+
 CONFIG_AVRDUDE_FUSE
   If you enable this option, a script will be launched just after this
   saving the configuration. This script uses avrdude to program the

___
Avr-list mailing list
Avr-list@droids-corp.org
CVSWEB : http://cvsweb.droids-corp.org/cgi-bin/viewcvs.cgi/aversive
WIKI : http://wiki.droids-corp.org/index.php/Aversive
DOXYGEN : http://zer0.droids-corp.org/doxygen_aversive/html/
BUGZILLA : http://bugzilla.droids-corp.org
COMMIT LOGS : http://zer0.droids-corp.org/aversive_commitlog


[Avr-list] aversive CVS_LOG 2009-03-02

2009-03-01 Par sujet root
Commit from zer0 (2009-03-01 15:43 CET)


Add some commands (sensors, cs).
Set the gains + coefs approximatively

  aversive_projects  microb2009/mainboard/strat_base.c  1.2
  aversive_projects  microb2009/mainboard/sensor.h  1.3
  aversive_projects  microb2009/mainboard/sensor.c  1.3
  aversive_projects  microb2009/mainboard/main.h1.3
  aversive_projects  microb2009/mainboard/main.c1.3
  aversive_projects  microb2009/mainboard/cs.h  1.2
  aversive_projects  microb2009/mainboard/cs.c  1.2
  aversive_projects  microb2009/mainboard/commands_mainboard.c  1.3
  aversive_projects  microb2009/mainboard/commands_gen.c1.3
  aversive_projects  microb2009/mainboard/commands_cs.c 1.3
  aversive_projects  microb2009/mainboard/commands.c1.3


===
aversive_projects/microb2009/mainboard/strat_base.c  (1.1 - 1.2)
===

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: strat_base.c,v 1.1 2009-02-27 22:23:37 zer0 Exp $
+ *  Revision : $Id: strat_base.c,v 1.2 2009-03-01 14:43:16 zer0 Exp $
  *
  */
 
@@ -143,11 +143,11 @@
strat_preinit();
 
/* if start sw not plugged */
-   if (sensor_start_switch()) {
+   if (sensor_get(S_START_SWITCH)) {
printf_P(PSTR(No start switch, press a key or plug it\r\n));
 
/* while start sw not plugged */
-   while (sensor_start_switch()) {
+   while (sensor_get(S_START_SWITCH)) {
if (cmdline_keypressed()) {
for (i=3; i0; i--) {
printf_P(PSTR(%d\r\n), i);
@@ -159,10 +159,10 @@
}

/* if start sw plugged */
-   if (!sensor_start_switch()) {
+   if (!sensor_get(S_START_SWITCH)) {
printf_P(PSTR(Ready, unplug start switch to start\r\n));
/* while start sw plugged */
-   while (!sensor_start_switch());
+   while (!sensor_get(S_START_SWITCH));
}
 
strat_init();


===
aversive_projects/microb2009/mainboard/sensor.h  (1.2 - 1.3)
===

@@ -16,14 +16,43 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: sensor.h,v 1.2 2009-02-27 22:23:37 zer0 Exp $
+ *  Revision : $Id: sensor.h,v 1.3 2009-03-01 14:43:16 zer0 Exp $
  *
  */
 
-#define SENSOR_ADC_COUNT 6
+/* synchronize with sensor.c */
+#define ADC_CSENSE1   0
+#define ADC_CSENSE2   1
+#define ADC_CSENSE3   2
+#define ADC_CSENSE4   3
+#define ADC_BATTERY1  4
+#define ADC_BATTERY2  5
+#define ADC_MAX   6
+
+/* synchronize with sensor.c */
+#define S_START_SWITCH 0
+#define S_CAP2 1
+#define S_CAP3 2
+#define S_CAP4 3
+#define S_CAP5 4
+#define S_CAP6 5
+#define S_CAP7 6
+#define S_CAP8 7
+#define S_RESERVED18
+#define S_RESERVED29
+#define S_RESERVED3   10
+#define S_RESERVED4   11
+#define S_RESERVED5   12
+#define S_RESERVED6   13
+#define S_RESERVED7   14
+#define S_RESERVED8   15
+#define SENSOR_MAX16
 
 void sensor_init(void);
-int16_t sensor_read_adc(uint8_t i);
 
-/* XXX */
-#define sensor_start_switch() 0
+/* get filtered values for adc */
+int16_t sensor_get_adc(uint8_t i);
+
+/* get filtered values of boolean sensors */
+uint16_t sensor_get_all(void);
+uint8_t sensor_get(uint8_t i);


===
aversive_projects/microb2009/mainboard/sensor.c  (1.2 - 1.3)
===

@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: sensor.c,v 1.2 2009-02-27 22:23:37 zer0 Exp $
+ *  Revision : $Id: sensor.c,v 1.3 2009-03-01 14:43:16 zer0 Exp $
  *
  */
 
@@ -45,6 +45,8 @@
 #include main.h
 #include sensor.h
 
+/ ADC */
+
 struct adc_infos {
uint16_t config;
int16_t value;
@@ -76,41 +78,31 @@
 
 #define ADC_CONF(x) ( ADC_REF_AVCC | ADC_MODE_INT | MUX_ADC##x )
 
-/* define which ADC to poll, update SENSOR_ADC_COUNT in sensor.h */
-static struct adc_infos adc_infos[SENSOR_ADC_COUNT] = { 
-#define ADC_CSENSE1   0
-   { .config = ADC_CONF(0), .filter = rii_medium },
-#define ADC_CSENSE2   1
-   { .config = ADC_CONF(1), .filter = rii_medium },
-#define ADC_CSENSE3   2
-   { .config = ADC_CONF(2), .filter = rii_medium },
-#define ADC_CSENSE4   3
-   { .config = ADC_CONF(3), .filter = rii_medium },
-#define 

[Avr-list] aversive CVS_LOG 2009-02-03

2009-02-02 Par sujet root
Commit from zer0 on branch b_zer0 (2009-02-02 23:21 CET)
=

Fix an ugly bug in u64_sqrt, u32_sqrt, u16_sqrt :
if number is 0, the function will loop forever.

Thanks to serpilliere for that.

  aversive  modules/devices/control_system/filters/quadramp/quadramp.c  1.4.4.6
  aversive  modules/base/math/fixed_point/f64_sqrt.c1.5.4.4
  aversive  modules/base/math/fixed_point/f32_sqrt.c1.5.4.4
  aversive  modules/base/math/fixed_point/f16_sqrt.c1.5.4.4


===
aversive/modules/devices/control_system/filters/quadramp/quadramp.c  (1.4.4.5 
- 1.4.4.6)
===

@@ -15,32 +15,19 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: quadramp.c,v 1.4.4.5 2007-12-31 16:25:00 zer0 Exp $
+ *  Revision : $Id: quadramp.c,v 1.4.4.6 2009-02-02 22:21:20 zer0 Exp $
  *
  */
 
 #include stdio.h
 #include string.h
+#include math.h
 
 #include aversive.h
 #include quadramp.h
 
 #define NEXT(n, i)  (((n) + (i)/(n))  1)
 
-static uint32_t u32_sqrt(uint32_t number) {
-   uint32_t n  = 1;
-   uint32_t n1 = NEXT(n, number);
-   
-   while(ABS(n1 - n)  1) {
-   n  = n1;
-   n1 = NEXT(n, number);
-   }
-   while((n1*n1)  number) {
-   n1 -= 1;
-   }
-   return n1;
-}
-
 void quadramp_init(struct quadramp_filter * q)
 {
uint8_t flags;
@@ -118,7 +105,7 @@
int32_t ramp_pos;
/* var_2nd_ord_neg  0 */
/* real EQ : sqrt( var_2nd_ord_neg^2/4 - 2.d.var_2nd_ord_neg ) 
+ var_2nd_ord_neg/2 */
-   ramp_pos = u32_sqrt( (var_2nd_ord_neg*var_2nd_ord_neg)/4 - 
2*d*var_2nd_ord_neg ) + var_2nd_ord_neg/2;
+   ramp_pos = sqrt( (var_2nd_ord_neg*var_2nd_ord_neg)/4 - 
2*d*var_2nd_ord_neg ) + var_2nd_ord_neg/2;
 
if(ramp_pos  var_1st_ord_pos)
var_1st_ord_pos = ramp_pos ;
@@ -129,7 +116,7 @@
 
/* var_2nd_ord_pos  0 */
/* real EQ : sqrt( var_2nd_ord_pos^2/4 - 2.d.var_2nd_ord_pos ) 
- var_2nd_ord_pos/2 */
-   ramp_neg = -u32_sqrt( (var_2nd_ord_pos*var_2nd_ord_pos)/4 - 
2*d*var_2nd_ord_pos ) - var_2nd_ord_pos/2;
+   ramp_neg = -sqrt( (var_2nd_ord_pos*var_2nd_ord_pos)/4 - 
2*d*var_2nd_ord_pos ) - var_2nd_ord_pos/2;

/* ramp_neg  0 */
if(ramp_neg  var_1st_ord_neg)


=
aversive/modules/base/math/fixed_point/f64_sqrt.c  (1.5.4.3 - 1.5.4.4)
=

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: f64_sqrt.c,v 1.5.4.3 2008-05-10 15:06:26 zer0 Exp $
+ *  Revision : $Id: f64_sqrt.c,v 1.5.4.4 2009-02-02 22:21:20 zer0 Exp $
  *
  */
 
@@ -29,6 +29,9 @@
uint64_t n  = 1;
uint64_t n1 = NEXT(n, number);

+   if (number == 0)
+   return 0;
+
while(ABS(n1 - n)  1) {
n  = n1;
n1 = NEXT(n, number);


=
aversive/modules/base/math/fixed_point/f32_sqrt.c  (1.5.4.3 - 1.5.4.4)
=

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: f32_sqrt.c,v 1.5.4.3 2008-05-10 15:06:26 zer0 Exp $
+ *  Revision : $Id: f32_sqrt.c,v 1.5.4.4 2009-02-02 22:21:20 zer0 Exp $
  *
  */
 
@@ -25,10 +25,14 @@
 
 #define NEXT(n, i)  (((n) + (i)/(n))  1)
 
-static uint32_t u32_sqrt(uint32_t number) {
+static uint32_t u32_sqrt(uint32_t number)
+{
uint32_t n  = 1;
uint32_t n1 = NEXT(n, number);

+   if (number == 0)
+   return 0;
+
while(ABS(n1 - n)  1) {
n  = n1;
n1 = NEXT(n, number);


=
aversive/modules/base/math/fixed_point/f16_sqrt.c  (1.5.4.3 - 1.5.4.4)
=

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: f16_sqrt.c,v 1.5.4.3 2008-05-10 15:06:26 zer0 Exp $
+ *  Revision : $Id: f16_sqrt.c,v 1.5.4.4 2009-02-02 22:21:20 zer0 Exp $
  *
  */
 
@@ -30,6 +30,9 @@
uint16_t n  = 1;
uint16_t n1 = NEXT(n, number);

+   if (number == 0)
+   return 0;
+
while(ABS(n1 - n)  1) {
n  = n1;
n1 = NEXT(n, 

[Avr-list] aversive CVS_LOG 2009-01-29

2009-01-28 Par sujet root
Commit from zer0 on branch b_zer0 (2009-01-29 00:26 CET)
=

Allow compilation for more archs.

  aversive  modules/base/scheduler/scheduler.c  1.9.4.5


===
aversive/modules/base/scheduler/scheduler.c  (1.9.4.4 - 1.9.4.5)
===

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: scheduler.c,v 1.9.4.4 2007-11-27 23:16:14 zer0 Exp $
+ *  Revision : $Id: scheduler.c,v 1.9.4.5 2009-01-28 23:26:01 zer0 Exp $
  *
  */
 
@@ -45,10 +45,10 @@
 
 #ifdef CONFIG_MODULE_SCHEDULER_TIMER0
/* activation of corresponding interrupt */
-   sbi(TIMSK, TOIE0); 
+   TOIE0_REG |= (1TOIE0); /* TIMSK */
 
TCNT0 = 0; 
-   TCCR0 = SCHEDULER_CK; 
+   CS00_REG = SCHEDULER_CK; /* TCCR0 */
 #endif
 }
 

___
Avr-list mailing list
Avr-list@droids-corp.org
CVSWEB : http://cvsweb.droids-corp.org/cgi-bin/viewcvs.cgi/aversive
WIKI : http://wiki.droids-corp.org/index.php/Aversive
DOXYGEN : http://zer0.droids-corp.org/doxygen_aversive/html/
BUGZILLA : http://bugzilla.droids-corp.org
COMMIT LOGS : http://zer0.droids-corp.org/aversive_commitlog


[Avr-list] aversive CVS_LOG 2009-01-04

2009-01-03 Par sujet root
Commit from zer0 (2009-01-03 17:19 CET)


add micrb_cmd and bootloader

+ aversive_projects  microb2009/microb_cmd/microbcmd.py  1.1
  aversive_projects  microb2009/tests/arm_test/.config   1.4
  aversive_projects  microb2009/tests/arm_test/Makefile  1.3
  aversive_projects  microb2009/tests/arm_test/commands.c1.3
  aversive_projects  microb2009/tests/arm_test/main.c1.3
  aversive_projects  microb2009/tests/arm_test/uart_config.h 1.2
+ aversive_projects  microb2009/tests/bootloader/Makefile1.1
+ aversive_projects  microb2009/tests/bootloader/error_config.h  1.1
+ aversive_projects  microb2009/tests/bootloader/main.c  1.1
+ aversive_projects  microb2009/tests/bootloader/uart_config.h   1.1



aversive_projects/microb2009/microb_cmd/microbcmd.py  (1.1)


@@ -0,0 +1,317 @@
+#! /usr/bin/env python
+
+import os,sys,termios,atexit
+import serial
+from select import select
+import cmd
+#from pylab import *
+import shlex
+import time
+
+import warnings
+warnings.filterwarnings(ignore,tempnam,RuntimeWarning, __name__)
+
+import logging
+log = logging.getLogger(MicrobShell)
+_handler = logging.StreamHandler()
+_handler.setFormatter(logging.Formatter(%(levelname)s: %(message)s))
+log.addHandler(_handler)
+log.setLevel(1)
+
+SPM_PAGE_SIZE = 256
+
+def crc_ccitt_update (crc, data):
+crc argument is the previous value of 16 bits crc (the initial
+value is 0x). 'data' is the 8 bits value added to crc. The
+function returns the new crc value.
+
+data ^= (crc  0xff)
+data ^= (data  4)
+data = 0xff
+
+ret = (data  8)  0x
+ret |= ((crc  8)  0xff)
+ret ^= ((data  4)  0xff)
+ret ^= ((data  3)  0x)
+return ret
+
+def prog_page(ser, addr, buf):
+program a page from buf at addr
+i = 0
+crc = 0x
+
+ser.flushInput()
+ser.write('p')
+s = ser.readline()
+if not s.endswith(addr?\r\n):
+print failed (don't match addr)
+return -1
+ser.write(%x\n%addr)
+s = ser.readline()
+if not s.startswith(addr ok):
+print failed
+return -1
+while i  SPM_PAGE_SIZE:
+if i = len(buf):
+c = '\xff'
+else:
+c = buf[i]
+ser.write(c)
+i += 1
+crc = crc_ccitt_update(crc, ord(c))
+sys.stdout.write(.)
+sys.stdout.flush()
+avr_crc = int(ser.readline()[0:4], 16)
+if crc != avr_crc:
+print failed: bad crc
+ser.write('n')
+return -1
+ser.write('y')
+s = ser.readline()
+if not s.startswith(OK):
+print failed
+return -1
+return 0
+
+def check_crc(ser, addr, buf):
+Process the crc of buf, ask for a crc of the flash, and check
+that value is correct
+crc = 0x
+size = len(buf) - addr
+if size = 0:
+return
+ser.flushInput()
+ser.write('c')
+s = ser.readline()
+if not s.startswith(addr?):
+print failed
+return -1
+ser.write(%x\n%addr)
+s = ser.readline()
+if not s.startswith(size?):
+print failed
+return -1
+ser.write(%x\n%size)
+i = addr
+while addr  addr + size:
+crc = crc_ccitt_update(crc, buf[i])
+avr_crc = int(ser.readline()[0:4], 16)
+if crc != avr_crc:
+print failed: bad crc
+return -1
+return 0
+
+class SerialLogger:
+def __init__(self, ser, filein, fileout=None):
+self.ser = ser
+self.filein = filein
+self.fin = open(filein, a, 0)
+if fileout:
+self.fileout = fileout
+self.fout = open(fileout, a, 0)
+else:
+self.fileout = filein
+self.fout = self.fin
+def fileno(self):
+return self.ser.fileno()
+def read(self, *args):
+res = self.ser.read(*args)
+self.fin.write(res)
+return res
+def write(self, s):
+self.fout.write(s)
+self.ser.write(s)
+
+
+
+class Interp(cmd.Cmd):
+prompt = Microb 
+def __init__(self, tty, baudrate=57600):
+cmd.Cmd.__init__(self)
+self.ser = serial.Serial(tty,baudrate=baudrate)
+self.escape  = \x01 # C-a
+self.quitraw = \x02 # C-b
+self.serial_logging = False
+self.default_in_log_file = /tmp/microb.in.log
+self.default_out_log_file = /tmp/microb.out.log
+
+def do_quit(self, args):
+return True
+
+def do_log(self, args):
+Activate serial logs.
+log filename   logs input and output to filename
+log filein fileout   logs input to filein and output to fileout
+log  logs to /tmp/microb.log or the last used 
file
+
+if self.serial_logging:
+log.error(Already logging to %s and %s % (self.ser.filein, 
+

[Avr-list] aversive CVS_LOG 2008-06-15

2008-06-14 Par sujet root
Commit from tof on branch b_tof (2008-06-14 10:02 CEST)
===

reset SW macro changed
kbd updated

  aversive  include/aversive.h  
 1.3.2.3
  aversive  modules/devices/ihm/kbd/kbd_matrix_4x4/doc/SCHEMA.DDB   
 1.1.2.2
  aversive  modules/devices/ihm/kbd/kbd_matrix_4x4_4port/kbd_matrix_4x4_4port.c 
 1.1.2.5


===
aversive/include/aversive.h  (1.3.2.2 - 1.3.2.3)
===

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: aversive.h,v 1.3.2.2 2008-02-11 10:40:52 tof Exp $
+ *  Revision : $Id: aversive.h,v 1.3.2.3 2008-06-14 08:02:46 tof Exp $
  *
  */
 
@@ -114,17 +114,41 @@
  *  use only if you need speed optimization !
  *  use  instead for current operations 
  */
-#define extr16_08_0(i) (*(char *)(i)) // LSB of a 16bit
-#define extr16_08_1(i) (*((char *)(i)+1)) // MSB of a 16bit
+#define extr16_08_0(i) (*(uint8_t *)(i)) // LSB of a 16bit
+#define extr16_08_1(i) (*((uint8_t *)(i)+1)) // MSB of a 16bit
+
+#define extr32_16_0(i) (*(uint16_t *)(i))  // LSB of a 32 bit
+#define extr32_16_1(i) (* (((uint16_t *)(i)) +1))  // MSB of a 32 bit
+//#define extr32_16_23(i) (*((uint16_t *)((uint8_t *)(i)+1))) // middle of a 
32 bit // deprecated
+
+#define extr32_08_0(i) (*(uint8_t *)(i)) // same stuff
+#define extr32_08_1(i) (*((uint8_t *)(i)+1))
+#define extr32_08_2(i) (*((uint8_t *)(i)+2))
+#define extr32_08_3(i) (*((uint8_t *)(i)+3))
+
+
+
+#define extr64_33_0(i) (*(uint32_t *)(i))
+#define extr64_32_1(i) (*((uint32_t *)(i)+1))
+
+#define extr64_16_0(i) (*(uint16_t *)(i))
+#define extr64_16_1(i) (*((uint16_t *)(i)+1))
+#define extr64_16_2(i) (*((uint16_t *)(i)+2))
+#define extr64_16_3(i) (*((uint16_t *)(i)+3))
+
+#define extr64_08_0(i) (*(uint8_t *)(i)) // same stuff
+#define extr64_08_1(i) (*((uint8_t *)(i)+1))
+#define extr64_08_2(i) (*((uint8_t *)(i)+2))
+#define extr64_08_3(i) (*((uint8_t *)(i)+3))
+#define extr64_08_4(i) (*((uint8_t *)(i)+4))
+#define extr64_08_5(i) (*((uint8_t *)(i)+5))
+#define extr64_08_6(i) (*((uint8_t *)(i)+6))
+#define extr64_08_7(i) (*((uint8_t *)(i)+7))
+
+
+
+
 
-#define extr32_16_0(i) (*(int *)(i))  // LSB of a 32 bit
-#define extr32_16_1(i) (* (((int *)(i)) +1))  // MSB of a 32 bit
-#define extr32_16_23(i) (*((int *)((char *)(i)+1))) // middle of a 32 bit
-
-#define extr32_08_0(i) (*(char *)(i)) // same stuff
-#define extr32_08_1(i) (*((char *)(i)+1))
-#define extr32_08_2(i) (*((char *)(i)+2))
-#define extr32_08_3(i) (*((char *)(i)+3))
 
 
 /* a few asm utilities */
@@ -141,13 +165,18 @@
 #ifndef sei
 #define sei() __asm__ __volatile__ (SEI\n) /** enable interrupts */
 #endif
-/** simple software reset, but doesn't initialize the registers */
+/** software reset through WDT
+   this procedure is recommended by atmel
+   
http://support.atmel.no/bin/customer?custSessionKey=customerLang=ennoCookies=trueaction=viewKbEntryid=21
+ */
 #ifndef reset
+#include avr/io.h
+#include avr/wdt.h
 #define reset()  \
 do {\
-  __asm__ __volatile__ (ldi r30,0\n);  \
-  __asm__ __volatile__ (ldi r31,0\n);  \
-  __asm__ __volatile__ (ijmp\n);  \
+   cli();   \
+   wdt_enable(WDTO_30MS);   \
+   while(1) {}; \
 } while(0)
 #endif
 


==
aversive/modules/devices/ihm/kbd/kbd_matrix_4x4/doc/SCHEMA.DDB  (1.1.2.1 - 
1.1.2.2)
==




aversive/modules/devices/ihm/kbd/kbd_matrix_4x4_4port/kbd_matrix_4x4_4port.c  
(1.1.2.4 - 1.1.2.5)


@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: kbd_matrix_4x4_4port.c,v 1.1.2.4 2008-03-16 15:12:49 tof 
Exp $
+ *  Revision : $Id: kbd_matrix_4x4_4port.c,v 1.1.2.5 2008-06-14 08:03:09 tof 
Exp $
  *
  */
 
@@ -224,10 +224,10 @@
 // ! a l ordre, car si on mettait d abord le port a 1, on aurait une 
impulsion sur le port
 // meme chose + haut
 
-if ((value  KBD_BIT2)!=0)
+if ((value  (1KBD_BIT2))!=0)
   return 0;  // no key pressed
 
-   value |= KBD_ROWS; // mise a 1 des bits de ligne, (inverse 
ensuite a 0, pour signifier ligne4)
+   value |= KBD_ROWS; // mise a 1 des bits de ligne, (inverse 
ensuite a 0, pour signifier ligne1)
   }
   
   

___
Avr-list mailing list
Avr-list@droids-corp.org
CVSWEB : 

[Avr-list] aversive CVS_LOG 2008-06-02

2008-06-01 Par sujet root
Commit from zer0 on branch b_zer0 (2008-06-01 22:36 CEST)
=

Only add comments.
Signed-off by serpilliere !

  aversive  modules/devices/robot/obstacle_avoidance/obstacle_avoidance.h  
1.1.2.4
  aversive  modules/devices/robot/obstacle_avoidance/obstacle_avoidance.c  
1.1.2.5


==
aversive/modules/devices/robot/obstacle_avoidance/obstacle_avoidance.h  
(1.1.2.3 - 1.1.2.4)
==

@@ -15,10 +15,38 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: obstacle_avoidance.h,v 1.1.2.3 2008-04-27 12:59:46 zer0 
Exp $
+ *  Revision : $Id: obstacle_avoidance.h,v 1.1.2.4 2008-06-01 20:36:30 zer0 
Exp $
  *
- *  Fabrice DESCLAUX [EMAIL PROTECTED]
- *  Olivier MATZ [EMAIL PROTECTED]
+ *  Main code and algorithm: Fabrice DESCLAUX [EMAIL PROTECTED]
+ *  Integration in Aversive: Olivier MATZ [EMAIL PROTECTED]
+ */
+
+/*
+ * The algorithm is based on the visible point algorithm.
+ * There are 3 inputs:
+ *   - the play ground (basically the table, here a rectangle)
+ *   - the objects to avoid, represented by polygones 
+ *   - start/stop points (A, B)
+ *
+ * The algorithm will first find every ray formed by 2 points that can
+ * see each others. Basically, if a polygon is between two points,
+ * they cannot see each others. A side of a polygon is composed by 2
+ * points that can se each others.
+ *
+ * From all these rays, we can create a graph. We affect for each ray
+ * a weight with its own length.
+ *
+ * The algorithm executes Dijkstra to find the shortest path to go
+ * from A to B.
+ */
+
+/*
+ * As we run on 4Ko ram uC, we have static structures arrays to store:
+ *  - MAX_POLY = represent the maximum polygons to avoid in the area.
+ *  - MAX_PTS = maximize the sum of every polygons vertices.
+ *  - MAX_RAYS = maximum number of rays. 
+ *  - MAX_CHKPOINTS = maximum accepted checkpoints in the resulting path.
+ *  - PLAYGROUND XXX = dimensions of the playground.
  */
 
 /* XXX this should be set in obstacle_avoidance_config.h !! */
@@ -42,6 +70,8 @@
/* used for dijkstra */
uint8_t p;
uint8_t pt;
+
+/* Used to determine if the destination point is reachable */
uint8_t valid;
 
 } oa_ext_point_t;
@@ -52,6 +82,12 @@
int16_t y;
 } oa_point_t;
 
+/* A line is represented by the equation:
+ *   a*x + b*y + c = 0
+ *  
+ *  This is better than classic a*x + b = y :
+ *  here we can handle vertical (a*x + 0*y + c = 0)
+ *  and horizontal lines (0*x + b*y + c = 0) */
 typedef struct _line {
int32_t a;
int32_t b;
@@ -64,7 +100,41 @@
 } oa_poly_t;
 
 
+struct obstacle_avoidance {
+   oa_poly_t polys[MAX_POLY];  /* tab of polygons (obstacles) */
+   oa_ext_point_t points[MAX_PTS]; /* tab of points, referenced by polys */
+   
+   uint8_t ray_n;
+   uint8_t cur_poly_idx;
+   uint8_t cur_pt_idx;
+
+   uint16_t weight[MAX_RAYS];
+   union {
+   uint8_t rays[MAX_RAYS*2];
+   oa_point_t res[MAX_CHKPOINTS];
+   } u;
+};
 
+/* To save memory space here is the moemory representation of
+ *   polygons/points:
+ *
+ *   We have an array of points (oa_ext_point_t points):  
+ *  _ _ _ _ _ _ _ _ _
+ * | | | | | | | | | |
+ * | p0  | p1  | p0  | p1  | p2  | p3  | p0  | p1  | p2  |
+ * |_|_|_|_|_|_|_|_|_|
+ *
+ *
+ *  ^^   ^
+ *  ||   |
+ *  -polygon 0   -polygon 1  -polygon 2
+ *  -2 vertices  -4 vertices -3 vertices
+ *
+ *
+ * And each polygon is represented by the sub array starting with the
+ * point represented by oa_ext_point_t * pts and composed of uint8_t l; 
+ * (in the oa_poly_t structure)
+ */
 
 /** Init the oa structure */
 void oa_init(void);


==
aversive/modules/devices/robot/obstacle_avoidance/obstacle_avoidance.c  
(1.1.2.4 - 1.1.2.5)
==

@@ -15,10 +15,10 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: obstacle_avoidance.c,v 1.1.2.4 2008-05-09 08:26:47 zer0 
Exp $
+ *  Revision : $Id: obstacle_avoidance.c,v 1.1.2.5 2008-06-01 20:36:30 zer0 
Exp $
  *
- *  Fabrice DESCLAUX [EMAIL PROTECTED]
- *  Olivier MATZ [EMAIL PROTECTED]
+ *  Main code and algorithm: Fabrice DESCLAUX [EMAIL PROTECTED]
+ *  Integration in Aversive: Olivier MATZ [EMAIL PROTECTED]
  */
 
 #include aversive.h
@@ -33,24 +33,12 @@
 
 #define debug_printf(args...)
 
-struct obstacle_avoidance {
-   

[Avr-list] aversive CVS_LOG 2008-05-13

2008-05-12 Par sujet root
Commit from zer0 on branch b_zer0 (2008-05-12 15:10 CEST)
=

Use bash instead of sh, and use SHELL variable.

  aversive  mk/aversive_project.mk  1.32.4.14


===
aversive/mk/aversive_project.mk  (1.32.4.13 - 1.32.4.14)
===

@@ -167,7 +167,7 @@
 export HOSTCC = gcc
 export REMOVE = rm -f
 export COPY = cp
-export SHELL = sh
+export SHELL = bash
 DATE=`date`
 MD5 = md5sum
 export AVRDUDE = avrdude
@@ -369,23 +369,23 @@
 # -- config targets
 
 config:
-   @sh -n $(AVERSIVE_DIR)/config/config.in
+   @${SHELL} -n $(AVERSIVE_DIR)/config/config.in
@HELP_FILE=$(AVERSIVE_DIR)/config/Configure.help \
AUTOCONF_FILE=autoconf.h \
-   sh $(AVERSIVE_DIR)/config/scripts/Configure 
$(AVERSIVE_DIR)/config/config.in
+   ${SHELL} $(AVERSIVE_DIR)/config/scripts/Configure 
$(AVERSIVE_DIR)/config/config.in
 
 noconfig:
-   @sh -n $(AVERSIVE_DIR)/config/config.in
+   @${SHELL} -n $(AVERSIVE_DIR)/config/config.in
@HELP_FILE=$(AVERSIVE_DIR)/config/Configure.help \
AUTOCONF_FILE=autoconf.h \
-   sh $(AVERSIVE_DIR)/config/scripts/Configure -d 
$(AVERSIVE_DIR)/config/config.in
+   ${SHELL} $(AVERSIVE_DIR)/config/scripts/Configure -d 
$(AVERSIVE_DIR)/config/config.in
 
 menuconfig:
-   @sh -n $(AVERSIVE_DIR)/config/config.in
+   @${SHELL} -n $(AVERSIVE_DIR)/config/config.in
@make -C $(AVERSIVE_DIR)/config/scripts/lxdialog all
@HELP_FILE=$(AVERSIVE_DIR)/config/Configure.help \
AUTOCONF_FILE=autoconf.h \
-   sh $(AVERSIVE_DIR)/config/scripts/Menuconfig 
$(AVERSIVE_DIR)/config/config.in
+   ${SHELL} $(AVERSIVE_DIR)/config/scripts/Menuconfig 
$(AVERSIVE_DIR)/config/config.in
 
 # -- clean targets
 

___
Avr-list mailing list
Avr-list@droids-corp.org
CVSWEB : http://cvsweb.droids-corp.org/cgi-bin/viewcvs.cgi/aversive
WIKI : http://wiki.droids-corp.org/index.php/Aversive
DOXYGEN : http://zer0.droids-corp.org/doxygen_aversive/html/
BUGZILLA : http://bugzilla.droids-corp.org
COMMIT LOGS : http://zer0.droids-corp.org/aversive_commitlog


[Avr-list] aversive CVS_LOG 2008-05-12

2008-05-11 Par sujet root
Commit from zer0 on branch b_zer0 (2008-05-11 17:04 CEST)
=

fix compilation with gcc 4.3

  aversive  include/aversive.h  1.1.2.5
  aversive  modules/encoding/hamming/hamming.c  1.2.4.4


===
aversive/include/aversive.h  (1.1.2.4 - 1.1.2.5)
===

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: aversive.h,v 1.1.2.4 2008-04-27 12:59:45 zer0 Exp $
+ *  Revision : $Id: aversive.h,v 1.1.2.5 2008-05-11 15:04:52 zer0 Exp $
  *
  */
 
@@ -110,24 +110,85 @@
 #define ABS(val) ( ((val)  0) ? -(val) : (val) )
 
 
-/* byte extraction, not recommended for use
- *  use only if you need speed optimization !
- *  use  instead for current operations 
- */
-#define extr16_08_0(i) (*(char *)(i)) // LSB of a 16bit
-#define extr16_08_1(i) (*((char *)(i)+1)) // MSB of a 16bit
-
-#define extr32_16_0(i) (*(int *)(i))  // LSB of a 32 bit
-#define extr32_16_1(i) (* (((int *)(i)) +1))  // MSB of a 32 bit
-#define extr32_16_23(i) (*((int *)((char *)(i)+1))) // middle of a 32 bit
-
-#define extr32_08_0(i) (*(char *)(i)) // same stuff
-#define extr32_08_1(i) (*((char *)(i)+1))
-#define extr32_08_2(i) (*((char *)(i)+2))
-#define extr32_08_3(i) (*((char *)(i)+3))
+/* 
+ * Extract bytes and u16 from larger integer
+ */
+
+#if __BYTE_ORDER != __LITTLE_ENDIAN  __BYTE_ORDER != __BIG_ENDIAN
+# errorEndianness not defined
+#endif
+
+struct extract32 {
+   union {
+   struct {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   uint8_t u8_0;
+   uint8_t u8_1;
+   uint8_t u8_2;
+   uint8_t u8_3;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   uint8_t u8_3;
+   uint8_t u8_2;
+   uint8_t u8_1;
+   uint8_t u8_0;
+#endif
+   } __attribute__ ((packed)) u8;
+   struct {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   uint16_t u16_0;
+   uint16_t u16_1;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   uint16_t u16_1;
+   uint16_t u16_0;
+#endif
+   } __attribute__ ((packed)) u16;
+   struct {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   uint8_t u8_0;
+   uint16_t u16_mid;
+   uint8_t u8_3;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   uint8_t u8_3;
+   uint16_t u16_mid;
+   uint8_t u8_0;
+#endif
+   } __attribute__ ((packed)) u16_b;
+   uint32_t u32;
+   } __attribute__ ((packed)) u;
+} __attribute__ ((packed));
+
+#define extr32_08_0(i) ({ struct extract32 __x; __x.u.u32 = i; __x.u.u8.u8_0; 
})
+#define extr32_08_1(i) ({ struct extract32 __x; __x.u.u32 = i; __x.u.u8.u8_1; 
})
+#define extr32_08_2(i) ({ struct extract32 __x; __x.u.u32 = i; __x.u.u8.u8_2; 
})
+#define extr32_08_3(i) ({ struct extract32 __x; __x.u.u32 = i; __x.u.u8.u8_3; 
})
+
+#define extr32_16_0(i) ({ struct extract32 __x; __x.u.u32 = i; 
__x.u.u16.u16_0; })
+#define extr32_16_1(i) ({ struct extract32 __x; __x.u.u32 = i; 
__x.u.u16.u16_1; })
+#define extr32_16_mid(i) ({ struct extract32 __x; __x.u.u32 = i; 
__x.u.u16_b.u16_mid; })
+
+
+struct extract16 {
+   union {
+   struct {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+   uint8_t u8_0;
+   uint8_t u8_1;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+   uint8_t u8_1;
+   uint8_t u8_0;
+#endif
+   } __attribute__ ((packed)) u8;
+   uint16_t u16;
+   } __attribute__ ((packed)) u;
+} __attribute__ ((packed));
+
+#define extr16_08_0(i) ({ struct extract16 __x; __x.u.u16 = i; __x.u.u8.u8_0; 
})
+#define extr16_08_1(i) ({ struct extract16 __x; __x.u.u16 = i; __x.u.u8.u8_1; 
})
+
 
 
 /* a few asm utilities */
+
 #ifndef HOST_VERSION
 #ifndef nop
 #define nop() __asm__ __volatile__ (NOP\n) /** nop instruction, 1 CPU cycle 
consumed */


===
aversive/modules/encoding/hamming/hamming.c  (1.2.4.3 - 1.2.4.4)
===

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: hamming.c,v 1.2.4.3 2007-08-19 10:39:31 zer0 Exp $
+ *  Revision : $Id: hamming.c,v 1.2.4.4 2008-05-11 15:04:53 zer0 Exp $
  *
  */
 
@@ -28,7 +28,7 @@
 /** \file hamming.c
  *  \brief Implementation for the Hamiing module.
  *
- *  \todo nothing.
+ *  \todo use progmem to store tables !
  *
  *  \test Seems to work
  *
@@ -125,16 +125,14 @@
 
   tmp = tab_abcd[(uint8_t)frame0x0F];
   
-
-  tmp |= 

[Avr-list] aversive CVS_LOG 2008-05-11

2008-05-10 Par sujet root
Commit from zer0 on branch b_zer0 (2008-05-10 17:06 CEST)
=


update fixed point lib to work with gcc 4.3

  aversive  modules/base/math/fixed_point/f16.h  1.6.4.3
  aversive  modules/base/math/fixed_point/f16_add.c  1.4.4.2
  aversive  modules/base/math/fixed_point/f16_div.c  1.3.4.2
  aversive  modules/base/math/fixed_point/f16_double.c   1.5.4.2
  aversive  modules/base/math/fixed_point/f16_int.c  1.5.4.2
  aversive  modules/base/math/fixed_point/f16_inv.c  1.5.4.2
  aversive  modules/base/math/fixed_point/f16_mul.c  1.5.4.2
  aversive  modules/base/math/fixed_point/f16_neg.c  1.4.4.2
  aversive  modules/base/math/fixed_point/f16_print.c1.4.4.2
  aversive  modules/base/math/fixed_point/f16_sqrt.c 1.5.4.3
  aversive  modules/base/math/fixed_point/f16_sub.c  1.4.4.2
  aversive  modules/base/math/fixed_point/f16_to_s16.h   1.3.6.2
  aversive  modules/base/math/fixed_point/f32.h  1.6.4.3
  aversive  modules/base/math/fixed_point/f32_add.c  1.4.4.2
  aversive  modules/base/math/fixed_point/f32_div.c  1.3.4.2
  aversive  modules/base/math/fixed_point/f32_double.c   1.5.4.2
  aversive  modules/base/math/fixed_point/f32_int.c  1.5.4.2
  aversive  modules/base/math/fixed_point/f32_inv.c  1.5.4.2
  aversive  modules/base/math/fixed_point/f32_mul.c  1.5.4.2
  aversive  modules/base/math/fixed_point/f32_neg.c  1.4.4.2
  aversive  modules/base/math/fixed_point/f32_print.c1.4.4.2
  aversive  modules/base/math/fixed_point/f32_sqrt.c 1.5.4.3
  aversive  modules/base/math/fixed_point/f32_sub.c  1.4.4.2
  aversive  modules/base/math/fixed_point/f32_to_s32.h   1.3.6.2
  aversive  modules/base/math/fixed_point/f64.h  1.6.4.3
  aversive  modules/base/math/fixed_point/f64_add.c  1.4.4.2
  aversive  modules/base/math/fixed_point/f64_div.c  1.3.4.2
  aversive  modules/base/math/fixed_point/f64_double.c   1.5.4.2
  aversive  modules/base/math/fixed_point/f64_int.c  1.5.4.2
  aversive  modules/base/math/fixed_point/f64_inv.c  1.5.4.2
  aversive  modules/base/math/fixed_point/f64_msb_mul.c  1.5.4.2
  aversive  modules/base/math/fixed_point/f64_mul.c  1.5.4.2
  aversive  modules/base/math/fixed_point/f64_neg.c  1.4.4.2
  aversive  modules/base/math/fixed_point/f64_print.c1.4.4.2
  aversive  modules/base/math/fixed_point/f64_sqrt.c 1.5.4.3
  aversive  modules/base/math/fixed_point/f64_sub.c  1.4.4.2
  aversive  modules/base/math/fixed_point/f64_to_s64.h   1.3.6.3
  aversive  modules/base/math/fixed_point/s16_to_f16.h   1.3.6.2
  aversive  modules/base/math/fixed_point/s32_to_f32.h   1.3.6.2
  aversive  modules/base/math/fixed_point/s64_to_f64.h   1.3.6.3



aversive/modules/base/math/fixed_point/f16.h  (1.6.4.2 - 1.6.4.3)


@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: f16.h,v 1.6.4.2 2007-05-23 17:18:10 zer0 Exp $
+ *  Revision : $Id: f16.h,v 1.6.4.3 2008-05-10 15:06:26 zer0 Exp $
  *
  */
 
@@ -41,23 +41,28 @@
 #include aversive.h
 
 typedef struct fixed_16 {
-uint8_t decimal;
-int8_t integer;
+   union {
+   struct {
+   uint8_t decimal;
+   int8_t integer;
+   } s;
+   int16_t s16;
+   } u;
 } f16;
+#define f16_decimal u.s.decimal
+#define f16_integer u.s.integer
 
 #define F16_ZERO (\
 { \
 f16 __f;  \
-__f.integer = 0;  \
-__f.decimal = 0;  \
+__f.u.s16 = 0;\
 __f;  \
 })
 
 #define F16_NAN (  \
 {  \
 f16 __f;   \
-__f.integer = 0xFF;\
-__f.decimal = 0xFF;\
+__f.u.s16 = 0x;\
 __f;   \
 })
 
@@ -67,8 +72,8 @@
 #define F16_IS_LE(x,y) (f16_to_s16(x) = f16_to_s16(y))
 #define F16_IS_EQ(x,y) (f16_to_s16(x) == f16_to_s16(y))
 #define F16_IS_NE(x,y) (f16_to_s16(x) != f16_to_s16(y))
-#define F16_IS_NEG(x)  ((x).integer  0)
-#define F16_IS_ZERO(x)  ((x).integer == 0  (x).decimal == 0)
+#define F16_IS_NEG(x)  ((x).f16_integer  0)
+#define F16_IS_ZERO(x)  ((x).f16_integer == 0  (x).f16_decimal == 0)
 
 
 /** convert a double to a f16 */



aversive/modules/base/math/fixed_point/f16_add.c  (1.4.4.1 - 1.4.4.2)


@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: f16_add.c,v 1.4.4.1 2006-11-26 21:06:00 zer0 Exp $
+ *  Revision : $Id: f16_add.c,v 1.4.4.2 2008-05-10 15:06:26 zer0 Exp $
  *
  */
 
@@ -27,6 +27,6 @@
 
 f16 f16_add(f16 a, f16 b)
 {
-  

[Avr-list] aversive CVS_LOG 2008-04-07

2008-04-06 Par sujet root
Commit from zer0 on branch b_zer0 (2008-04-06 19:33 CEST)
=

fix some bugs in trajectory, pwm, position_manager

  aversive  config/Configure.help   
   1.13.4.14
  aversive  config/config.in
   1.42.4.19
  aversive  config/prog_fuses.sh
   1.3.4.5
  aversive  mk/aversive_project.mk  
   1.32.4.13
  aversive  
modules/devices/robot/blocking_detection_manager/blocking_detection_manager.c  
1.1.2.4
  aversive  modules/devices/robot/position_manager/position_manager.c   
   1.6.4.4
  aversive  modules/devices/robot/robot_system/robot_system.c   
   1.6.4.6
  aversive  modules/devices/robot/robot_system/robot_system.h   
   1.5.4.3
  aversive  modules/devices/robot/trajectory_manager/trajectory_manager.c   
   1.4.4.11
  aversive  modules/hardware/pwm/pwm.c  
   1.8.4.8
  aversive  modules/hardware/pwm/pwm.h  
   1.7.4.7


==
aversive/config/Configure.help  (1.13.4.13 - 1.13.4.14)
==

@@ -216,6 +216,10 @@
   wheels. It provides a virtual angle/distance PWM and a virtual
   angle/distance encoder.
 
+CONFIG_MODULE_ROBOT_SYSTEM_MOT_AND_EXT
+  If the robot has external and motor encoder, you can use both 
+  by defining this option.
+
 CONFIG_MODULE_POSITION_MANAGER
   This module processes the position of the robot, depending of the 
   value returned by the associated robot system, and some physical


=
aversive/config/config.in  (1.42.4.18 - 1.42.4.19)
=

@@ -318,6 +318,9 @@
 dep_bool 'Robot System' CONFIG_MODULE_ROBOT_SYSTEM \
$CONFIG_MODULE_FIXED_POINT
 
+dep_bool '  |-- Allow motor and external encoders' 
CONFIG_MODULE_ROBOT_SYSTEM_MOT_AND_EXT \
+   $CONFIG_MODULE_ROBOT_SYSTEM
+
  POSITION_MANAGER
 dep_bool 'Position manager' CONFIG_MODULE_POSITION_MANAGER \
$CONFIG_MODULE_ROBOT_SYSTEM


=
aversive/config/prog_fuses.sh  (1.3.4.4 - 1.3.4.5)
=

@@ -140,7 +140,7 @@
   do
   rm -f $f 2 /dev/null
   echo 0x00  ${f}_new
-  ${AVRDUDE} -p ${MCU} -P `echo ${AVRDUDE_PORT} | sed 's,,,g'` -c 
${AVRDUDE_PROGRAMMER} -U ${f}:r:${f}:i ${DELAY}
+  ${AVRDUDE} ${DELAY} -p ${MCU} -P `echo ${AVRDUDE_PORT} | sed 's,,,g'` -c 
${AVRDUDE_PROGRAMMER} -U ${f}:r:${f}:i
   if [ ! -f $f ]; then
   CANNOT_READ=1
   fi


===
aversive/mk/aversive_project.mk  (1.32.4.12 - 1.32.4.13)
===

@@ -111,7 +111,7 @@
 AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).$(FORMAT_EXTENSION)
 #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
 
-AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -q
+AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
 
 ifneq ($(AVRDUDE_DELAY),)
 AVRDUDE_FLAGS += -i $(AVRDUDE_DELAY)


==
aversive/modules/devices/robot/blocking_detection_manager/blocking_detection_manager.c
  (1.1.2.3 - 1.1.2.4)
==

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: blocking_detection_manager.c,v 1.1.2.3 2008-03-30 22:00:56 
zer0 Exp $
+ *  Revision : $Id: blocking_detection_manager.c,v 1.1.2.4 2008-04-06 17:33:57 
zer0 Exp $
  *
  *  Olivier MATZ [EMAIL PROTECTED]
  */
@@ -74,7 +74,7 @@
i = bd-k1 * cmd - bd-k2 * speed;
if (ABS(i)  bd-i_thres) {
if (bd-cpt == bd-cpt_thres - 1)
-   DEBUG(E_BLOCKING_DETECTION_MANAGER, 
+   WARNING(E_BLOCKING_DETECTION_MANAGER, 
  BLOCKING cmd=%ld, speed=%ld i=%ld,
  cmd, speed, i);
if(bd-cpt  bd-cpt_thres)


==
aversive/modules/devices/robot/position_manager/position_manager.c  (1.6.4.3 - 
1.6.4.4)
==

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: position_manager.c,v 1.6.4.3 2008-03-31 16:51:27 zer0 Exp $
+ *  Revision : $Id: position_manager.c,v 1.6.4.4 2008-04-06 17:33:57 zer0 Exp $
  *
  */
 
@@ -89,6 +89,7 @@
IRQ_UNLOCK(flags);
 }
 
+#ifdef 

[Avr-list] aversive CVS_LOG 2008-04-01

2008-03-31 Par sujet root
Commit from zer0 on branch b_zer0 (2008-03-31 18:51 CEST)
=

update position_manager and angle_distance

  aversive  modules/devices/robot/position_manager/position_manager.c  1.6.4.3
  aversive  modules/devices/robot/robot_system/angle_distance.c1.4.4.3


==
aversive/modules/devices/robot/position_manager/position_manager.c  (1.6.4.2 - 
1.6.4.3)
==

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: position_manager.c,v 1.6.4.2 2007-08-19 10:39:31 zer0 Exp $
+ *  Revision : $Id: position_manager.c,v 1.6.4.3 2008-03-31 16:51:27 zer0 Exp $
  *
  */
 
@@ -109,7 +109,7 @@
  */
 void position_manage(struct robot_position * pos)
 {
-   double x, y, a;
+   double x, y, a, r, arc_angle;
s16 x_s16, y_s16, a_s16;
struct rs_polar encoders;
struct rs_polar delta;
@@ -148,17 +148,28 @@
x = pos-pos_d.x;
y = pos-pos_d.y;
IRQ_UNLOCK(flags);
-  
-   a += (double) delta.angle / (pos-phys.track_cm * 
pos-phys.distance_imp_per_cm/2);
+
+
+   if (delta.angle == 0) {
+   /* we go straight */
+   x = x + cos(a) * ((double) delta.distance / 
(pos-phys.distance_imp_per_cm)) ;
+   y = y + sin(a) * ((double) delta.distance / 
(pos-phys.distance_imp_per_cm)) ;
+   }
+   else {
+   /* r the radius of the circle arc */
+   r = (double)delta.distance * pos-phys.track_cm / (double) 
delta.angle;
+   arc_angle = (double) delta.angle / (pos-phys.track_cm * 
pos-phys.distance_imp_per_cm);
+
+   x += r * (-sin(a) + sin(a+arc_angle));
+   y += r * (cos(a) - cos(a+arc_angle));
+   a += arc_angle;
+   }
 
if(a  -M_PI)
a += (M_PI*2);
else if (a  (M_PI))
a -= (M_PI*2);
 
-   x += cos(a) * ((double) delta.distance / 
(pos-phys.distance_imp_per_cm)) ;
-   y += sin(a) * ((double) delta.distance / 
(pos-phys.distance_imp_per_cm)) ;
-
/* update int position */
x_s16 = (int16_t)x;
y_s16 = (int16_t)y;



aversive/modules/devices/robot/robot_system/angle_distance.c  (1.4.4.2 - 
1.4.4.3)


@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: angle_distance.c,v 1.4.4.2 2007-06-17 21:23:41 zer0 Exp $
+ *  Revision : $Id: angle_distance.c,v 1.4.4.3 2008-03-31 16:51:27 zer0 Exp $
  *
  */
 
@@ -27,8 +27,8 @@
  */
 void rs_get_polar_from_wheels(struct rs_polar * p_dst, struct rs_wheels * 
w_src)
 {
-   p_dst-distance = w_src-right + w_src-left;
-   p_dst-angle= w_src-right - w_src-left;
+   p_dst-distance = (w_src-right + w_src-left) / 2;
+   p_dst-angle= (w_src-right - w_src-left) / 2;
 }
 
 /**
@@ -36,7 +36,7 @@
  */
 void rs_get_wheels_from_polar(struct rs_wheels * w_dst, struct rs_polar * 
p_src)
 {
-   w_dst-left  = (p_src-distance - p_src-angle) / 2;
-   w_dst-right = (p_src-distance + p_src-angle) / 2;
+   w_dst-left  = p_src-distance - p_src-angle;
+   w_dst-right = p_src-distance + p_src-angle;
 }
 


Commit from zer0 (2008-03-31 18:51 CEST)


update coefs after position_manager modification

  aversive_projects  microb2008/main/main.h  1.15



aversive_projects/microb2008/main/main.h  (1.14 - 1.15)


@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: main.h,v 1.14 2008-03-30 22:02:53 zer0 Exp $
+ *  Revision : $Id: main.h,v 1.15 2008-03-31 16:51:47 zer0 Exp $
  *
  */
 
@@ -42,11 +42,11 @@
 #define EXT_TRACK_CM 29.9
 #define VIRTUAL_TRACK_CM EXT_TRACK_CM 
 
-/* it should be a 2000 imps ; huh ?
+/* it is a 2000 imps - 8000 because we see 1/4 period
  * and diameter: 40.5mm - perimeter 127.23mm 
- * 16000/12.723 - 1257.565 */
+ * 8000/12.723 - 628.78 */
 /* increase it to go further */
-#define DIST_IMP_CM 1270.0
+#define DIST_IMP_CM 635.0
 
 #define LEFT_ENCODER_MOT((void *)1)
 #define RIGHT_ENCODER_MOT   ((void *)0)


Commit from zer0 on branch b_zer0 (2008-04-01 00:16 CEST)
=

fix comment

  aversive  modules/devices/robot/trajectory_manager/trajectory_manager.c  
1.4.4.9
  aversive  modules/devices/robot/trajectory_manager/trajectory_manager.h  
1.4.4.7


==

[Avr-list] aversive CVS_LOG 2008-03-31

2008-03-30 Par sujet root
Commit from zer0 on branch b_zer0 (2008-03-31 00:00 CEST)
=

remove old style's blocking detection

  aversive  
modules/devices/robot/blocking_detection_manager/blocking_detection_manager.c  
1.1.2.3
  aversive  
modules/devices/robot/blocking_detection_manager/blocking_detection_manager.h  
1.1.2.5


==
aversive/modules/devices/robot/blocking_detection_manager/blocking_detection_manager.c
  (1.1.2.2 - 1.1.2.3)
==

@@ -15,38 +15,25 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: blocking_detection_manager.c,v 1.1.2.2 2008-03-27 19:20:49 
zer0 Exp $
+ *  Revision : $Id: blocking_detection_manager.c,v 1.1.2.3 2008-03-30 22:00:56 
zer0 Exp $
  *
  *  Olivier MATZ [EMAIL PROTECTED]
  */
 
 /* blocking detection manager */
 
+#include stdio.h
 #include string.h
 #include aversive/error.h
 
 #include blocking_detection_manager.h
 
 /** init module, give the robot system to use as a parameter */
-void bd_init(struct blocking_detection * bd, struct cs *cs)
+void bd_init(struct blocking_detection * bd)
 {
uint8_t flags;
IRQ_LOCK(flags);
memset(bd, 0, sizeof(*bd));
-   bd-cs = cs;
-   IRQ_UNLOCK(flags);
-}
-
-/* thresholds */
-void bd_set_speed_err_thresholds(struct blocking_detection * bd, uint32_t 
speed_thres, 
-uint32_t err_thres, uint16_t cpt_thres)
-{
-   uint8_t flags;
-   IRQ_LOCK(flags);
-   bd-speed_thres = speed_thres;
-   bd-err_thres = err_thres;
-   bd-cpt1_thres = cpt_thres;
-   bd-cpt1 = 0;
IRQ_UNLOCK(flags);
 }
 
@@ -60,8 +47,8 @@
bd-k1 = k1;
bd-k2 = k2;
bd-i_thres = i_thres;
-   bd-cpt2_thres = cpt_thres;
-   bd-cpt2 = 0;
+   bd-cpt_thres = cpt_thres;
+   bd-cpt = 0;
IRQ_UNLOCK(flags);
 }
 
@@ -70,67 +57,55 @@
 {
uint8_t flags;
IRQ_LOCK(flags);
-   bd-cpt1 = 0;
-   bd-cpt2 = 0;
+   bd-cpt = 0;
IRQ_UNLOCK(flags);
 }
 
+
+
 /** function to be called periodically */
-void bd_manage(struct blocking_detection * bd)
+void bd_manage_from_speed_cmd(struct blocking_detection * bd, 
+ int32_t speed, int32_t cmd)  
 {
-   int32_t err=0;
-   int32_t pos;
-   int32_t cmd;
int32_t i=0;
-   int32_t speed;
-
-   static uint8_t a=0;
-
-   pos = cs_get_filtered_feedback(bd-cs);
-   speed = (pos - bd-prev_pos);
-
-   /* if blocking detection enabled */
-   if ( bd-cpt1_thres ) {
-   err = cs_get_error(bd-cs);
-   if ((ABS(err)  bd-err_thres 
-ABS(speed)  bd-speed_thres)) {
-   if (bd-cpt1 == bd-cpt1_thres - 1)
-   DEBUG(E_BLOCKING_DETECTION_MANAGER, 
- A: err=%ld speed=%ld,
- ABS(err), ABS(speed));
-   
-   if(bd-cpt1  bd-cpt1_thres)
-   bd-cpt1++;
-   }
-   else {
-   bd-cpt2=0;
-   }
-   }
-
 
/* if current-based blocking_detection enabled */
-   if ( bd-cpt2_thres ) {
-   cmd = cs_get_out(bd-cs);
-   i = bd-k1 * cmd - bd-k2*speed;
+   if ( bd-cpt_thres ) {
+   i = bd-k1 * cmd - bd-k2 * speed;
if (ABS(i)  bd-i_thres) {
-   if (bd-cpt2 == bd-cpt2_thres - 1)
+   if (bd-cpt == bd-cpt_thres - 1)
DEBUG(E_BLOCKING_DETECTION_MANAGER, 
- A: i=%ld, i);
-   if(bd-cpt2  bd-cpt2_thres)
-   bd-cpt2++;
+ BLOCKING cmd=%ld, speed=%ld i=%ld,
+ cmd, speed, i);
+   if(bd-cpt  bd-cpt_thres)
+   bd-cpt++;
}
else {
-   bd-cpt2=0;
+   bd-cpt=0;
+   }
+#if BD_DEBUG
+   if (bd-debug_cpt++ == BD_DEBUG) {
+   DEBUG(E_BLOCKING_DETECTION_MANAGER, cmd=%ld, speed=%ld 
i=%ld,
+ cmd, speed, i);
+   bd-debug_cpt = 0;
}
}
+#endif
+}
 
-   if (a++ == 0)
-   DEBUG(E_BLOCKING_DETECTION_MANAGER, 
- test err=%ld speed=%ld i=%ld,
- ABS(err), ABS(speed), i);
-
+/** function to be called periodically */
+void bd_manage_from_pos_cmd(struct blocking_detection * bd, 
+   int32_t pos, int32_t cmd)   

[Avr-list] aversive CVS_LOG 2008-03-24

2008-03-23 Par sujet root
Commit from enseirb on branch b_eirbot (2008-03-23 14:33 CET)
==

unioc_asserv/

+ aversive  projects/coupe2008/unioc_asserv/Makefile 1.1.2.1
+ aversive  projects/coupe2008/unioc_asserv/autoconf.h   1.1.2.1
+ aversive  projects/coupe2008/unioc_asserv/encoders_unioc_config.h  1.1.2.1
+ aversive  projects/coupe2008/unioc_asserv/main.c   1.1.2.1
+ aversive  projects/coupe2008/unioc_asserv/pid_config.h 1.1.2.1
+ aversive  projects/coupe2008/unioc_asserv/pwm_config.h 1.1.2.1
+ aversive  projects/coupe2008/unioc_asserv/scheduler_config.h   1.1.2.1
+ aversive  projects/coupe2008/unioc_asserv/uart_config.h1.1.2.1


=
aversive/projects/coupe2008/unioc_asserv/Makefile  (1.1.2.1)
=

@@ -0,0 +1,22 @@
+TARGET = main
+
+# repertoire des modules
+AVERSIVE_DIR = ../../..
+# VALUE, absolute or relative path : example ../.. #
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c
+
+# List Assembler source files here.
+# Make them always end in a capital .S.  Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon make clean!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC = 
+
+
+
+-include .aversive_conf
+include $(AVERSIVE_DIR)/mk/aversive_project.mk


===
aversive/projects/coupe2008/unioc_asserv/autoconf.h  (1.1.2.1)
===

@@ -0,0 +1,240 @@
+/*
+ * Automatically generated by make menuconfig: don't edit
+ */
+#define AUTOCONF_INCLUDED
+
+/*
+ * Hardware
+ */
+#undef  CONFIG_MCU_AT90S2313
+#undef  CONFIG_MCU_AT90S2323
+#undef  CONFIG_MCU_AT90S
+#undef  CONFIG_MCU_AT90S2343
+#undef  CONFIG_MCU_ATTINY22
+#undef  CONFIG_MCU_ATTINY26
+#undef  CONFIG_MCU_AT90S4414
+#undef  CONFIG_MCU_AT90S4433
+#undef  CONFIG_MCU_AT90S4434
+#undef  CONFIG_MCU_AT90S8515
+#undef  CONFIG_MCU_AT90S8534
+#undef  CONFIG_MCU_AT90S8535
+#undef  CONFIG_MCU_AT86RF401
+#undef  CONFIG_MCU_ATMEGA103
+#undef  CONFIG_MCU_ATMEGA603
+#undef  CONFIG_MCU_AT43USB320
+#undef  CONFIG_MCU_AT43USB355
+#undef  CONFIG_MCU_AT76C711
+#undef  CONFIG_MCU_ATMEGA8
+#undef  CONFIG_MCU_ATMEGA48
+#undef  CONFIG_MCU_ATMEGA88
+#undef  CONFIG_MCU_ATMEGA8515
+#undef  CONFIG_MCU_ATMEGA8535
+#undef  CONFIG_MCU_ATTINY13
+#undef  CONFIG_MCU_ATTINY2313
+#undef  CONFIG_MCU_ATMEGA16
+#undef  CONFIG_MCU_ATMEGA161
+#undef  CONFIG_MCU_ATMEGA162
+#undef  CONFIG_MCU_ATMEGA163
+#undef  CONFIG_MCU_ATMEGA165
+#undef  CONFIG_MCU_ATMEGA168
+#undef  CONFIG_MCU_ATMEGA169
+#undef  CONFIG_MCU_ATMEGA32
+#undef  CONFIG_MCU_ATMEGA323
+#undef  CONFIG_MCU_ATMEGA325
+#undef  CONFIG_MCU_ATMEGA3250
+#undef  CONFIG_MCU_ATMEGA64
+#undef  CONFIG_MCU_ATMEGA645
+#undef  CONFIG_MCU_ATMEGA6450
+#define CONFIG_MCU_ATMEGA128 1
+#undef  CONFIG_MCU_AT90CAN128
+#undef  CONFIG_MCU_AT94K
+#undef  CONFIG_MCU_AT90S1200
+#define CONFIG_QUARTZ (800)
+
+/*
+ * Generation options
+ */
+#define CONFIG_OPTM_0 1
+#undef  CONFIG_OPTM_1
+#undef  CONFIG_OPTM_2
+#undef  CONFIG_OPTM_3
+#undef  CONFIG_OPTM_S
+#define CONFIG_MATH_LIB 1
+#define CONFIG_FDEVOPEN_COMPAT 1
+#undef  CONFIG_MINIMAL_PRINTF
+#undef  CONFIG_STANDARD_PRINTF
+#define CONFIG_ADVANCED_PRINTF 1
+#define CONFIG_FORMAT_IHEX 1
+#undef  CONFIG_FORMAT_SREC
+#undef  CONFIG_FORMAT_BINARY
+
+/*
+ * Base modules
+ */
+#define CONFIG_MODULE_CIRBUF 1
+#undef  CONFIG_MODULE_CIRBUF_LARGE
+#define CONFIG_MODULE_FIXED_POINT 1
+#define CONFIG_MODULE_VECT2 1
+#define CONFIG_MODULE_SCHEDULER 1
+#define CONFIG_MODULE_SCHEDULER_CREATE_CONFIG 1
+#undef  CONFIG_MODULE_SCHEDULER_USE_TIMERS
+#define CONFIG_MODULE_SCHEDULER_TIMER0 1
+#undef  CONFIG_MODULE_SCHEDULER_MANUAL
+#undef  CONFIG_MODULE_TIME
+#undef  CONFIG_MODULE_TIME_CREATE_CONFIG
+
+/*
+ * Communication modules
+ */
+#define CONFIG_MODULE_UART 1
+#define CONFIG_MODULE_UART_CREATE_CONFIG 1
+#undef  CONFIG_MODULE_I2C
+#undef  CONFIG_MODULE_I2C_MASTER
+#undef  CONFIG_MODULE_I2C_MULTIMASTER
+#undef  CONFIG_MODULE_I2C_CREATE_CONFIG
+#undef  CONFIG_MODULE_I2C_EIRBOT
+#undef  CONFIG_MODULE_I2C_EIRBOT_CREATE_CONFIG
+#undef  CONFIG_MODULE_MF2_CLIENT
+#undef  CONFIG_MODULE_MF2_CLIENT_USE_SCHEDULER
+#undef  CONFIG_MODULE_MF2_CLIENT_CREATE_CONFIG
+#undef  CONFIG_MODULE_MF2_SERVER
+#undef  CONFIG_MODULE_MF2_SERVER_CREATE_CONFIG
+
+/*
+ * Hardware modules
+ */
+#undef  CONFIG_MODULE_TIMER
+#undef  CONFIG_MODULE_TIMER_CREATE_CONFIG
+#undef  CONFIG_MODULE_TIMER_DYNAMIC
+#define CONFIG_MODULE_PWM 1
+#define CONFIG_MODULE_PWM_CREATE_CONFIG 1
+#undef  CONFIG_MODULE_ADC
+#undef  

[Avr-list] aversive CVS_LOG 2008-03-11

2008-03-10 Par sujet root
Commit from enseirb on branch b_eirbot (2008-03-10 08:34 CET)
==

unioc encoders added to config files

  aversive  config/config.in 1.48.2.4
  aversive  config/generate_aversive_config  1.26.2.4


=
aversive/config/config.in  (1.48.2.3 - 1.48.2.4)
=

@@ -341,12 +341,18 @@
 dep_bool '  |-- Create Default encoders_microb config' 
CONFIG_MODULE_ENCODERS_MICROB_CREATE_CONFIG \
$CONFIG_MODULE_ENCODERS_MICROB
 
- ENCODERS
-bool 'Encoders (eirbot)' CONFIG_MODULE_ENCODERS_EIRBOT
+ ENCODERS EIRBOT 2k5
+bool 'Encoders (eirbot 2k5)' CONFIG_MODULE_ENCODERS_EIRBOT
 
 dep_bool '  |-- Create Default encoders_eirbot config' 
CONFIG_MODULE_ENCODERS_EIRBOT_CREATE_CONFIG \
$CONFIG_MODULE_ENCODERS_EIRBOT
 
+ ENCODERS EIRBOT UNIOC
+bool 'Encoders (eirbot unioc)' CONFIG_MODULE_ENCODERS_UNIOC
+
+dep_bool '  |-- Create Default encoders_unioc config' 
CONFIG_MODULE_ENCODERS_UNIOC_CREATE_CONFIG \
+   $CONFIG_MODULE_ENCODERS_UNIOC
+
 endmenu # (encoders)
 
 mainmenu_option next_comment



aversive/config/generate_aversive_config  (1.26.2.3 - 1.26.2.4)


@@ -28,6 +28,7 @@

CONFIG_MODULE_CCAU,devices/ccau/ccau
   CONFIG_MODULE_ENCODERS_MICROB,devices/encoders/encoders_microb
   CONFIG_MODULE_ENCODERS_EIRBOT,devices/encoders/encoders_eirbot
+   
CONFIG_MODULE_ENCODERS_UNIOC,devices/encoders/encoders_unioc
   CONFIG_MODULE_TRAJECTORY_MANAGER,devices/robot/trajectory_manager
   
CONFIG_MODULE_BLOCKING_DETECTION_MANAGER,devices/robot/blocking_detection_manager
   CONFIG_MODULE_OBSTACLE_AVOIDANCE,devices/robot/obstacle_avoidance

___
Avr-list mailing list
Avr-list@droids-corp.org
CVSWEB : http://cvsweb.droids-corp.org/cgi-bin/viewcvs.cgi/aversive
WIKI : http://wiki.droids-corp.org/index.php/Aversive
DOXYGEN : http://zer0.droids-corp.org/doxygen_aversive/html/
BUGZILLA : http://bugzilla.droids-corp.org
COMMIT LOGS : http://zer0.droids-corp.org/aversive_commitlog


[Avr-list] aversive CVS_LOG 2008-02-21

2008-02-20 Par sujet root
Commit from tof (2008-02-20 13:18 CET)
===

correction de pas mal de bugs dans le test.
celui ci devrait etre a peu pres fonctionnel

  aversive_projects  tof2007/taillage_engrenages_final/.config
1.2
  aversive_projects  tof2007/taillage_engrenages_final/adc_config.h   
1.2
  aversive_projects  tof2007/taillage_engrenages_final/main.c 
1.2
  aversive_projects  tof2007/taillage_engrenages_final/pap_goto_pos.c 
1.2
  aversive_projects  tof2007/taillage_engrenages_final/pap_goto_pos_config.h  
1.2


===
aversive_projects/tof2007/taillage_engrenages_final/.config  (1.1 - 1.2)
===

@@ -75,14 +75,14 @@
 CONFIG_MODULE_WAIT=y
 CONFIG_MODULE_LIST=y
 CONFIG_MODULE_SCHEDULER=y
-CONFIG_MODULE_SCHEDULER_CREATE_CONFIG=y
+# CONFIG_MODULE_SCHEDULER_CREATE_CONFIG is not set
 # CONFIG_MODULE_TIME is not set
 # CONFIG_MODULE_TIME_CREATE_CONFIG is not set
 
 #
 # Communication modules
 #
-# CONFIG_MODULE_UART is not set
+CONFIG_MODULE_UART=y
 # CONFIG_MODULE_UART_CREATE_CONFIG is not set
 
 #
@@ -91,7 +91,7 @@
 # CONFIG_MODULE_PWM is not set
 # CONFIG_MODULE_PWM_CREATE_CONFIG is not set
 CONFIG_MODULE_ADC=y
-CONFIG_MODULE_ADC_CREATE_CONFIG=y
+# CONFIG_MODULE_ADC_CREATE_CONFIG is not set
 
 #
 # IHM modules
@@ -110,7 +110,7 @@
 # CONFIG_MODULE_KBD_MATRIX_4X4 is not set
 # CONFIG_MODULE_KBD_MATRIX_4X4_CREATE_CONFIG is not set
 CONFIG_MODULE_KBD_MATRIX_4X4_4PORT=y
-CONFIG_MODULE_KBD_MATRIX_4X4_4PORT_CREATE_CONFIG=y
+# CONFIG_MODULE_KBD_MATRIX_4X4_4PORT_CREATE_CONFIG is not set
 # CONFIG_MODULE_MULTISERVO is not set
 # CONFIG_MODULE_MULTISERVO_CREATE_CONFIG is not set
 



aversive_projects/tof2007/taillage_engrenages_final/adc_config.h  (1.1 - 1.2)


@@ -1,7 +1,7 @@
 #ifndef _ADC_CONFIG_H_
 #define _ADC_CONFIG_H_
 
-// mappage des entrées ADC (noms utilisateur)
+// mappage des entrees ADC (noms utilisateur)
 #define MUX_ADC_X   MUX_ADC1
 #define MUX_ADC_Y   MUX_ADC2
 #define MUX_ADC_Z   MUX_ADC0
@@ -9,17 +9,12 @@
 
 
 // constantes venant de l'ADC travaillant sur 10 bits
-#define JOYSTICK_MAX_VALUE   1024
-#define JOYSTICK_NEUTRE   512
-
-#define JOYSTICK_ZONE_MORTE   128 // zone morte de 1/4 de la course
-
-// calcul de la valeur nette maximale
-#define JOYSTICK_H   (JOYSTICK_MAX_VALUE - JOYSTICK_NEUTRE - 
JOYSTICK_ZONE_MORTE)
-#define JOYSTICK_B   ( 0 - JOYSTICK_NEUTRE + 
JOYSTICK_ZONE_MORTE)
-#define JOYSTICK_NET_VALEUR_MAX (JOYSTICK_H-JOYSTICK_B  ?  JOYSTICK_H  :  
-JOYSTICK_B)
+#define JOYSTICK_EXCURSION480 // valeur brute max en + ou - theoriquement 
512, mais les halls ne sont pas vraiment rail2rail
+#define JOYSTICK_NEUTRE   512 // mi-course
 
+#define JOYSTICK_ZONE_MORTE   64 // zone morte de 1/8
 
+#define JOYSTICK_NET_VALEUR_MAX  (JOYSTICK_EXCURSION - JOYSTICK_ZONE_MORTE)
 
 
 #endif // _ADC_CONFIG_H_


==
aversive_projects/tof2007/taillage_engrenages_final/main.c  (1.1 - 1.2)
==

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: main.c,v 1.1 2008-02-11 14:32:29 tof Exp $
+ *  Revision : $Id: main.c,v 1.2 2008-02-20 12:18:12 tof Exp $
  *
  */
  
@@ -25,7 +25,7 @@
 #include adc.h
 //#include uart.h
 #include stdio.h
-#include aversive_pgmspace.h
+#include avr/pgmspace.h
 #include scheduler.h
 #include lcd.h
 #include kbd.h
@@ -100,7 +100,7 @@
break;

case KBD_RELEASED:
-   printf(\f);
+   //printf(\f);
g_affichage_joy_active = 1;
break;
}
@@ -111,7 +111,7 @@
 
 int main(void)
 {
-   // uart désactivée
+   // uart (debug)
   //uart_init();
   //fdevopen((void *)uart0_send,NULL,0);

@@ -124,7 +124,7 @@
lcd_init(LCD_DISP_ON);
fdevopen((void*)lcd_dev_putc ,NULL, 0);
  
-  printf_P(PSTR(\fBonjour\ntest des moteurs));
+  printf_P(PSTR(\fBonjour 17/02 2\ntest des moteurs));
wait_ms(1000);
printf_P(PSTR(\f));

@@ -133,8 +133,8 @@
scheduler_add_periodical_event_priority(pap_manage, NULL, 1, 250);   
//high prio à 4kHz

int max_speed= PAP_FREQ_MAX;  // vitesse max pendant le 
deplacement vers un point
-   int min_speed= PAP_FREQ_MAX / 100;// vitesse de démarrage
-   int acceleration = 20 ;   // accélération max. unités = 
pas² / 25.6ms
+   int min_speed= 0; // vitesse de démarrage
+   int acceleration = 10 ;   

[Avr-list] aversive CVS_LOG 2008-01-11

2008-01-10 Par sujet root
Commit from zer0 (2008-01-10 20:21 CET)


another merge from b_zer0

  aversive  config/config.in
1.48
  aversive  mk/aversive_project.mk  
1.38
  aversive  
modules/devices/control_system/control_system_manager/control_system_manager.h  
1.10
  aversive  modules/devices/control_system/filters/ramp/ramp.h  
1.5
  aversive  modules/devices/encoders/encoders_microb/encoders_microb.c  
1.8
  aversive  
modules/devices/robot/blocking_detection_manager/blocking_detection_manager.h   
1.3


=
aversive/config/config.in  (1.47 - 1.48)
=

@@ -330,11 +330,10 @@
$CONFIG_MODULE_FIXED_POINT
 
  BLOCKING DETECTION MANAGER
-dep_bool 'Blocking detection manager' CONFIG_MODULE_BLOCKING_DETECTION_MANAGER 
\
-   $CONFIG_MODULE_ROBOT_SYSTEM
+bool 'Blocking detection manager' CONFIG_MODULE_BLOCKING_DETECTION_MANAGER
 
  OBSTACLE AVOIDANCE
-dep_bool 'Obstacle Avoidance' CONFIG_MODULE_OBSTACLE_AVOIDANCE
+bool 'Obstacle Avoidance' CONFIG_MODULE_OBSTACLE_AVOIDANCE
 
 endmenu # (robot)
 


===
aversive/mk/aversive_project.mk  (1.37 - 1.38)
===

@@ -113,8 +113,8 @@
 
 AVRDUDE_FLAGS = -e -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -q
 
-ifneq ($(DELAY),)
-AVRDUDE_FLAGS += -i $(DELAY)
+ifneq ($(AVRDUDE_DELAY),)
+AVRDUDE_FLAGS += -i $(AVRDUDE_DELAY)
 endif
 
 export AVRDUDE_FLAGS


===
aversive/modules/devices/control_system/control_system_manager/control_system_manager.h
  (1.9 - 1.10)
===

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: control_system_manager.h,v 1.9 2008-01-08 20:05:03 zer0 
Exp $
+ *  Revision : $Id: control_system_manager.h,v 1.10 2008-01-10 19:21:48 zer0 
Exp $
  *
  */
 
@@ -114,22 +114,22 @@
 void cs_manage(void * cs);
 
 /** Return the last process out send to process */
-int32_t cs_get_out( struct cs* cs);
+int32_t cs_get_out(struct cs* cs);
 
 /** Return the last calculated error */
-int32_t cs_get_error( struct cs* cs);
+int32_t cs_get_error(struct cs* cs);
 
 /** Return the current consign */
-int32_t cs_get_consign( struct cs* cs);
+int32_t cs_get_consign(struct cs* cs);
 
 /** Return the current consign, after filter */
-int32_t cs_get_filtered_consign( struct cs* cs);
+int32_t cs_get_filtered_consign(struct cs* cs);
 
 /** Return the last feedback value, after filter */
-int32_t cs_get_filtered_feedback( struct cs* cs);
+int32_t cs_get_filtered_feedback(struct cs* cs);
 
 /** Change the consign without calculating control system */
-void cs_set_consign( struct cs* cs, int32_t v);
+void cs_set_consign(struct cs* cs, int32_t v);
 
 
 #endif /* #ifndef _CONTROL_SYSTEM_MANAGER_ */


===
aversive/modules/devices/control_system/filters/ramp/ramp.h  (1.4 - 1.5)
===

@@ -37,9 +37,9 @@
 /** \brief Definition of structur ramp_filter */
 
 struct ramp_filter {
-  uint32_t var_neg; /**Authorized negative variation*/
-  uint32_t var_pos; /**Authorized positive variation*/
-  int32_t prev_out;/**Previous value calculated*/
+   uint32_t var_neg; /**Authorized negative variation*/
+   uint32_t var_pos; /**Authorized positive variation*/
+   int32_t prev_out;/**Previous value calculated*/
 };
 
 


===
aversive/modules/devices/encoders/encoders_microb/encoders_microb.c  (1.7 - 
1.8)
===

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: encoders_microb.c,v 1.7 2007-05-24 13:08:47 zer0 Exp $
+ *  Revision : $Id: encoders_microb.c,v 1.8 2008-01-10 19:21:48 zer0 Exp $
  *
  */
 
@@ -57,7 +57,6 @@
 
 #include aversive.h
 #include aversive/wait.h
-#include f64.h
 
 #include encoders_microb.h
 #include encoders_microb_config.h


==
aversive/modules/devices/robot/blocking_detection_manager/blocking_detection_manager.h
  (1.2 - 1.3)
==

@@ -15,16 +15,19 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : 

[Avr-list] aversive CVS_LOG 2007-12-06

2007-12-05 Par sujet root
Commit from zer0 on branch b_zer0 (2007-12-05 19:08 CET)
=

Add ability to filter the derivate term in the PID

  aversive  config/Configure.help   
1.13.4.11
  aversive  config/config.in
1.42.4.13
  aversive  modules/devices/control_system/filters/pid/pid.c
1.5.4.4
  aversive  modules/devices/control_system/filters/pid/pid.h
1.4.4.5
  aversive  modules/devices/control_system/filters/pid/config/pid_config.h  
1.1.10.2
  aversive  modules/devices/control_system/filters/pid/test/.config 
1.7.4.8
  aversive  modules/devices/control_system/filters/pid/test/main.c  
1.4.6.3
  aversive  modules/devices/control_system/filters/pid/test/pid_config.h
1.1.10.2


==
aversive/config/Configure.help  (1.13.4.10 - 1.13.4.11)
==

@@ -232,6 +232,10 @@
 CONFIG_MODULE_PID
   This filter provides a PID (proportionnal, integral, derivate).
 
+CONFIG_MODULE_PID_CREATE_CONFIG
+  Create a pid_config.h file if it does not exist, with a default
+  configuration.
+
 CONFIG_MODULE_RAMP
   This module limits the variation of the input of the filter. It can
   be used in a speed control system as a consign filter to set a 


=
aversive/config/config.in  (1.42.4.12 - 1.42.4.13)
=

@@ -328,6 +328,9 @@
 
 bool 'PID' CONFIG_MODULE_PID
 
+dep_bool '  |-- Create Default PID config' CONFIG_MODULE_PID_CREATE_CONFIG \
+   $CONFIG_MODULE_PID
+
 bool 'ramp' CONFIG_MODULE_RAMP
 
 bool 'Quadramp' CONFIG_MODULE_QUADRAMP


=
aversive/modules/devices/control_system/filters/pid/pid.c  (1.5.4.3 - 1.5.4.4)
=

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: pid.c,v 1.5.4.3 2007-12-04 09:29:25 zer0 Exp $
+ *  Revision : $Id: pid.c,v 1.5.4.4 2007-12-05 18:08:39 zer0 Exp $
  *
  */
 
@@ -30,6 +30,7 @@
IRQ_LOCK(flags);
memset(p, 0, sizeof(*p));
p-gain_P = 1 ;
+   p-derivate_nb_samples = 1;
IRQ_UNLOCK(flags);
 }
 
@@ -61,6 +62,22 @@
IRQ_UNLOCK(flags);
 }
 
+int8_t pid_set_derivate_filter(struct pid_filter *p, uint8_t nb_samples)
+{
+   uint8_t flags;
+   int8_t ret;
+   IRQ_LOCK(flags);
+   if (nb_samples  PID_DERIVATE_FILTER_MAX_SIZE) {
+   ret = -1;
+   }
+   else {
+   p-derivate_nb_samples = nb_samples;
+   ret = 0;
+   }
+   IRQ_UNLOCK(flags);
+   return ret;
+}
+
 int16_t pid_get_gain_P(struct pid_filter *p)
 {
return (p-gain_P);
@@ -98,6 +115,11 @@
return (p-out_shift);
 }
 
+uint8_t pid_get_derivate_filter(struct pid_filter *p)
+{
+   return (p-derivate_nb_samples);
+}
+
 int32_t pid_get_value_I(struct pid_filter *p)
 {
uint8_t flags;
@@ -113,7 +135,7 @@
uint8_t flags;
int32_t ret;
IRQ_LOCK(flags);
-   ret = (p-prev_in);
+   ret = p-prev_samples[p-index];
IRQ_UNLOCK(flags);
return ret;
 }
@@ -123,7 +145,7 @@
uint8_t flags;
int32_t ret;
IRQ_LOCK(flags);
-   ret = (p-prev_D);
+   ret = p-prev_D;
IRQ_UNLOCK(flags);
return ret;
 }
@@ -144,6 +166,7 @@
int32_t derivate ;
int32_t command ;
struct pid_filter * p = data;
+   uint8_t prev_index;

/* 
 * Integral value : the integral become bigger with time .. (think
@@ -151,12 +174,19 @@
 * integral = previous integral + current value
 */
 
-   /* derivate value*/
-   /* f(t+h) - f(t)with f(t+h) = current value  */
-   /*  derivate = - f(t)   = previous value */
-   /*h  */
-   /* so derivate = current error - previous error  */
-   derivate = in - p-prev_in ;
+   /* derivate value 
+   * f(t+h) - f(t)with f(t+h) = current value
+   *  derivate = - f(t)   = previous value
+   *h
+   * so derivate = current error - previous error
+   *
+   * We can apply a filter to reduce noise on the derivate term,
+   * by using a bigger period.
+   */
+   
+   prev_index = p-index + 1;
+   prev_index %= p-derivate_nb_samples;
+   derivate = in - p-prev_samples[prev_index];
 
/* saturate input... it influences integral */
if (p-max_in)
@@ -182,9 +212,11 @@
 
 
/* backup of current error value (for the next calcul of derivate 
value) */
-   

[Avr-list] aversive CVS_LOG 2007-11-28

2007-11-27 Par sujet root
Commit from zer0 on branch b_zer0 (2007-11-28 00:16 CET)
=

Allow scheduler to be scheduled manually

  aversive  config/Configure.help 1.13.4.10
  aversive  config/config.in  1.42.4.12
  aversive  modules/base/scheduler/scheduler.c1.9.4.4
  aversive  modules/base/scheduler/scheduler.h1.8.4.8
  aversive  modules/base/scheduler/scheduler_private.h1.1.2.7
  aversive  modules/base/scheduler/config/scheduler_config.h  1.1.10.8
  aversive  modules/base/scheduler/test/scheduler_config.h1.4.10.7
  aversive  modules/base/time/time.c  1.4.4.2


==
aversive/config/Configure.help  (1.13.4.9 - 1.13.4.10)
==

@@ -62,10 +62,14 @@
   Create a scheduler_config.h file if it does not exist, with a default
   configuration.
 
-CONFIG_MODULE_SCHEDULER_USE_TIMERS
-  Use the hardware/timer module to call the scheduler. Thanks to it,
-  it can support many archs and timers. If you don't enable it, you
-  must use TIMER0 overflow interrupt, and only some AVR are supported.
+CONFIG_MODULE_SCHEDULER_TIMER0
+  Use either the hardware/timer module, the timer0 or a manual call 
+  for the to call the scheduler. The generic timer module support 
+  many archs and timers. If you don't enable it, you must use TIMER0 
+  overflow interrupt, and only some AVR are supported, or you should
+  can call the scheduler manually. In this case, the SCHEDULER_UNIT 
+  macro has to be defined in configuration file.
+
 
 CONFIG_TIME
   This module can be used to get a human readable time. It uses the


=
aversive/config/config.in  (1.42.4.11 - 1.42.4.12)
=

@@ -129,9 +129,9 @@
 dep_bool '  |-- Create Default scheduler config' 
CONFIG_MODULE_SCHEDULER_CREATE_CONFIG \
$CONFIG_MODULE_SCHEDULER
 
-dep_bool '  |-- Use timer module (recommended)' 
CONFIG_MODULE_SCHEDULER_USE_TIMERS \
-   $CONFIG_MODULE_TIMER \
-   $CONFIG_MODULE_SCHEDULER
+choice 'Scheduler config' use_timer_module CONFIG_MODULE_SCHEDULER_USE_TIMERS\
+ use_timer0 CONFIG_MODULE_SCHEDULER_TIMER0\
+ manual CONFIG_MODULE_SCHEDULER_MANUAL use_timer_module
 
  TIME
 dep_bool 'Time' CONFIG_MODULE_TIME \


===
aversive/modules/base/scheduler/scheduler.c  (1.9.4.3 - 1.9.4.4)
===

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: scheduler.c,v 1.9.4.3 2007-05-23 17:18:11 zer0 Exp $
+ *  Revision : $Id: scheduler.c,v 1.9.4.4 2007-11-27 23:16:14 zer0 Exp $
  *
  */
 
@@ -41,7 +41,9 @@
 
 #ifdef CONFIG_MODULE_SCHEDULER_USE_TIMERS
SCHEDULER_TIMER_REGISTER();
-#else
+#endif
+
+#ifdef CONFIG_MODULE_SCHEDULER_TIMER0
/* activation of corresponding interrupt */
sbi(TIMSK, TOIE0); 
 
@@ -51,7 +53,7 @@
 }
 
 
-#ifndef CONFIG_MODULE_SCHEDULER_USE_TIMERS
+#ifdef CONFIG_MODULE_SCHEDULER_TIMER0
 SIGNAL(SIG_OVERFLOW0)
 {
scheduler_interrupt();


===
aversive/modules/base/scheduler/scheduler.h  (1.8.4.7 - 1.8.4.8)
===

@@ -1,5 +1,5 @@
 /*  
- *  Copyright Droids Corporation, Microb Technology, Eirbot (2005)
+ *  Copyright Droids Corporation (2007)
  * 
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -15,20 +15,15 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: scheduler.h,v 1.8.4.7 2007-10-28 22:26:39 zer0 Exp $
+ *  Revision : $Id: scheduler.h,v 1.8.4.8 2007-11-27 23:16:15 zer0 Exp $
  *
  */
 
-/* Eirbot  Microb Technology 2005 - Zer0
+/* Olivier MATZ [EMAIL PROTECTED]
  * Interface of the SCHEDULER Module
  */
 
 /** \file scheduler.h
- *  \brief Interface of the SCHEDULER Module
- *
- *  \todo multi arch ?
- *
- *  \test nothing done
  *
  * This module provides a function scheduler. You can call
  * scheduler_add_event for adding a function to the scheduler, and
@@ -94,16 +89,21 @@
 #else
 #error Bad SCHEDULER_TIMER_NUM value in config file
 #endif
-#else /* CONFIG_MODULE_SCHEDULER_USE_TIMERS */
-#define SCHEDULER_TIMER_BITS 8
+
 #endif /* CONFIG_MODULE_SCHEDULER_USE_TIMERS */
 
+#ifdef CONFIG_MODULE_SCHEDULER_TIMER0
+#define SCHEDULER_TIMER_BITS 8
+#endif /* CONFIG_MODULE_SCHEDULER_TIMER0 */
+
+#ifndef CONFIG_MODULE_SCHEDULER_MANUAL
+
 /** TIME_UNIT is the number of microseconds between each interruption
  * if the prescaler equals 1 */
 #if SCHEDULER_TIMER_BITS == 8
-#define TIMER_UNIT ( 25600LL / (CONFIG_QUARTZ) )
+#define TIMER_UNIT_FLOAT ( 25600.0 / (double)(CONFIG_QUARTZ) 

[Avr-list] aversive CVS_LOG 2007-10-29

2007-10-28 Par sujet root
Commit from zer0 on branch b_zer0 (2007-10-28 23:26 CET)
=

Add some macros

  aversive  include/aversive/pgmspace.h  1.1.2.2



aversive/include/aversive/pgmspace.h  (1.1.2.1 - 1.1.2.2)


@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: pgmspace.h,v 1.1.2.1 2007-05-23 17:18:09 zer0 Exp $
+ *  Revision : $Id: pgmspace.h,v 1.1.2.2 2007-10-28 22:26:19 zer0 Exp $
  *
  */
 
@@ -33,11 +33,29 @@
 
 #else
 
+#include stdint.h
+
 #define printf_P printf
+#define memcmp_P memcmp
+#define strlen_P strlen
 #define vfprintf_P vfprintf
 #define vsprintf_P vsprintf
 #define PGM_P const char *
 #define PSTR(x) x
+#define PROGMEM
+#define pgm_read_word(x) (*(x))
+#define pgm_read_byte(x) (*(x))
+
+typedef void prog_void;
+typedef char prog_char;
+typedef unsigned char prog_uchar;
+typedef int8_t prog_int8_t;
+typedef uint8_t prog_uint8_t;
+typedef int16_t prog_int16_t;
+typedef uint16_t prog_uint16_t;
+typedef int32_t prog_int32_t;
+typedef uint32_t prog_uint32_t;
+typedef int64_t prog_int64_t;
 
 #endif /* HOST_VERSION */
 #endif /* _AVERSIVE_PGMSPACE_H_ */


Commit from zer0 on branch b_zer0 (2007-10-28 23:26 CET)
=

Better accuracy of scheduler.

  aversive  modules/base/scheduler/scheduler_interrupt.c  1.1.2.3
  aversive  modules/base/scheduler/scheduler.h1.8.4.7


=
aversive/modules/base/scheduler/scheduler_interrupt.c  (1.1.2.2 - 1.1.2.3)
=

@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: scheduler_interrupt.c,v 1.1.2.2 2007-05-23 17:18:11 zer0 
Exp $
+ *  Revision : $Id: scheduler_interrupt.c,v 1.1.2.3 2007-10-28 22:26:39 zer0 
Exp $
  *
  */
 
@@ -32,15 +32,16 @@
 static volatile uint8_t nb_stacking=0;

 
-/** this function is called from a timer interruption. If an event has
+/** 
+ *  this function is called from a timer interruption. If an event has
  *  to be scheduled, it will execute the fonction (IRQ are allowed
- *  during the execution of the function. This interruption can be
- *  interrupted by itself too, in this case it cannot executed events
- *  with a lower priority.  
+ *  during the execution of the function). This interruption can be
+ *  interrupted by itself too, in this case only events with a higher
+ *  priority can be scheduled.
  * 
  *  We assume that this function is called from a SIGNAL(), with
  *  global interrupt flag disabled -- that's why we can use cli() and
- *  sei() instead of IRQ_LOCK(f).
+ *  sei() instead of IRQ_LOCK(flags).
  */
 void
 scheduler_interrupt(void)
@@ -52,62 +53,75 @@
 
/* maximize the number of imbrications */
if (nb_stacking = SCHEDULER_NB_STACKING_MAX) {
-   sei();
return;
}
nb_stacking ++;
sei();
 
-
SLIST_INIT(event_list);
 
/* browse events table to determine which events should be
 * scheduled */
for (i=0 ; iSCHEDULER_NB_MAX_EVENT ; i++) {
cli();
-   /* decrement timer for event if it is active */
-   if (g_tab_event[i].state == SCHEDULER_EVENT_ACTIVE 
-   g_tab_event[i].current_time  0) {
-   g_tab_event[i].current_time --;
-   
-   /* don't need to schedule now */
-   if ( g_tab_event[i].current_time != 0 ) {
-   sei();
-   continue;
-   }
-   
-   /* time to schedule, but priority is too low,
-  delay it */
-   if (g_tab_event[i].priority  priority_running) {
-   g_tab_event[i].current_time = 1;
-   sei();
-   continue;
-   }
-   
-   /* schedule it, because timer reached 0 and
-  priority is greater than the one of the
-  running task */
-   g_tab_event[i].state = SCHEDULER_EVENT_SCHEDULED;
+
+   /* the event is already present in a schedule list,
+* only update its current time until it reaches 1 */
+   if (g_tab_event[i].state == SCHEDULER_EVENT_SCHEDULED 
+   g_tab_event[i].current_time  1) {
+   //  g_tab_event[i].current_time --;
sei();
-   
-   /* insert it in 

[Avr-list] aversive CVS_LOG 2007-08-21

2007-08-20 Par sujet root
Commit from zer0 on branch b_zer0 (2007-08-20 21:08 CEST)
-


Replace macros by static inline.

  aversive  
modules/devices/control_system/control_system_manager/control_system_manager.c  
1.7.4.2
  aversive  modules/devices/robot/robot_system/robot_system.c   
1.6.4.4


---
aversive/modules/devices/control_system/control_system_manager/control_system_manager.c
  (1.7.4.1 - 1.7.4.2)
---

***
*** 15,21 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: control_system_manager.c,v 1.7.4.1 2006-11-26 21:06:03 
zer0 Exp $
   *
   */
  #include stdio.h
--- 15,21 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: control_system_manager.c,v 1.7.4.2 2007-08-20 19:08:31 
zer0 Exp $
   *
   */
  #include stdio.h
***
*** 36,55 
   * - if pointer is null, return the IN value
   * - else apply filter
   */
! #define SAFE_FILTER( f, param, value ) ({ \
! int32_t (*__f)(void *, int32_t);  \
! int32_t __tmp = value;\
! void * __param ;  \
! uint8_t __flags; \
! IRQ_LOCK(__flags);\
! __f = f;  \
! __param = param;  \
! IRQ_UNLOCK(__flags);  \
! if ( __f ) {  \
! __tmp = __f(__param, value);  \
! } \
! __tmp; \
! })
  
  /** Call a processout() pointer : 
   * - lock the interrupts
--- 36,56 
   * - if pointer is null, return the IN value
   * - else apply filter
   */
! static inline uint32_t
! safe_filter(int32_t (*f)(void *, int32_t), void * param, int32_t value)
! {
!   int32_t (*f_tmp)(void *, int32_t);
!   void * param_tmp;
!   uint8_t flags;
!   IRQ_LOCK(flags);
!   f_tmp = f;
!   param_tmp = param;
!   IRQ_UNLOCK(flags);
!   if (f_tmp) {
!   return f_tmp(param_tmp, value);
!   }
!   return value;
! }
  
  /** Call a processout() pointer : 
   * - lock the interrupts
***
*** 58,77 
   * - if pointer is null, return 0
   * - else return the value processed by the function
   */
! #define SAFE_GETPROCESSOUT( f, param ) ({ \
! int32_t (*__f)(void *);   \
! int32_t __tmp = 0;\
! void * __param ;  \
! uint8_t __flags; \
! IRQ_LOCK(__flags);\
! __f = f;  \
! __param = param;  \
! IRQ_UNLOCK(__flags);  \
! if ( __f ) {  \
! __tmp = __f(__param); \
! } \
! __tmp; \
! })
  
  /** Call a processin() pointer : 
   * - lock the interrupts
--- 59,79 
   * - if pointer is null, return 0
   * - else return the value processed by the function
   */
! static inline uint32_t
! safe_getprocessout(int32_t (*f)(void *), void * param)
! {
!   int32_t (*f_tmp)(void *);
!   void * param_tmp;
!   uint8_t flags;
!   IRQ_LOCK(flags);
!   f_tmp = f;
!   param_tmp = param;
!   IRQ_UNLOCK(flags);
!   if (f_tmp) {
!   return f_tmp(param_tmp);
!   }
!   return 0;
! }
  
  /** Call a processin() pointer : 
   * - lock the interrupts
***
*** 80,97 
   * - if pointer is null, don't do anything
   * - else call the processin with the parameters
   */
! #define SAFE_SETPROCESSIN( f, param, value ) do {  \
! void (*__f)(void *, int32_t);  \
! void * __param ;   \
! uint8_t __flags;  \
! IRQ_LOCK(__flags); \
! __f = f;   \
! __param = param;   \
! IRQ_UNLOCK(__flags);   \
! if ( __f ) {   \
! __f(__param, value);   \
! }  \
! } while(0)
  
  /**/
  
--- 82,101 
   * - if pointer is null, don't do anything
   * - else call the processin with the parameters
   */
! static inline void
! safe_setprocessin(void (*f)(void *, int32_t), void * param, int32_t value)
! {
!   void 

[Avr-list] aversive CVS_LOG 2007-06-13

2007-06-13 Par sujet root
 is not set
  # CONFIG_MODULE_AES_CTR is not set
  # CONFIG_MODULE_MD5 is not set
***
*** 164,175 
--- 180,199 
  #
  # Encodings modules
  #
+ 
+ #
+ # Encoding modules depend on utils module
+ #
  # CONFIG_MODULE_BASE64 is not set
  # CONFIG_MODULE_HAMMING is not set
  
  #
  # Debug modules
  #
+ 
+ #
+ # Debug modules depend on utils module
+ #
  # CONFIG_MODULE_DIAGNOSTIC is not set
  # CONFIG_MODULE_DIAGNOSTIC_CREATE_CONFIG is not set
  CONFIG_MODULE_ERROR=y


Commit from zer0 on branch b_zer0 (2007-06-12 18:18 CEST)
-


optimize integer sqrt() function

  aversive  modules/devices/control_system/filters/quadramp/quadramp.c  1.4.4.4
  aversive  modules/base/math/fixed_point/f16_sqrt.c1.5.4.2
  aversive  modules/base/math/fixed_point/f32_sqrt.c1.5.4.2
  aversive  modules/base/math/fixed_point/f64_sqrt.c1.5.4.2
  aversive  modules/base/math/fixed_point/test/main.c   1.5.4.2


---
aversive/modules/devices/control_system/filters/quadramp/quadramp.c  (1.4.4.3 
- 1.4.4.4)
---

***
*** 15,21 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: quadramp.c,v 1.4.4.3 2007-05-23 17:18:13 zer0 Exp $
   *
   */
  
--- 15,21 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: quadramp.c,v 1.4.4.4 2007-06-12 16:18:43 zer0 Exp $
   *
   */
  
***
*** 24,53 
  #include aversive.h
  #include quadramp.h
  
! /* could be optimized... */
! static inline uint32_t  u32_sqrt(uint32_t x)
! {
! uint32_t root=0x8000;
! uint32_t mask=0x8000;
  
! while(mask) {
! if( root*root  x ) {
! mask = 1;
! root |= mask;
! }
! else if ( root*root  x ) {
! root = ~(mask);
! mask = 1;
! root |= mask;
! continue;
! }
! else 
! break;
! }
! return root;
  }
  
! inline void quadramp_init(struct quadramp_filter * q)
  {
uint8_t flags;
IRQ_LOCK(flags);
--- 24,46 
  #include aversive.h
  #include quadramp.h
  
! #define NEXT(n, i)  (((n) + (i)/(n))  1)
  
! static uint32_t u32_sqrt(uint32_t number) {
!   uint32_t n  = 1;
!   uint32_t n1 = NEXT(n, number);
!   
!   while(ABS(n1 - n)  1) {
!   n  = n1;
!   n1 = NEXT(n, number);
!   }
!   while((n1*n1)  number) {
!   n1 -= 1;
!   }
!   return n1;
  }
  
! void quadramp_init(struct quadramp_filter * q)
  {
uint8_t flags;
IRQ_LOCK(flags);
***
*** 62,68 
IRQ_UNLOCK(flags);
  }
  
! inline void quadramp_set_2nd_order_vars(struct quadramp_filter * q, uint32_t 
var_2nd_ord_pos, uint32_t var_2nd_ord_neg)
  {
uint8_t flags;
IRQ_LOCK(flags);
--- 55,61 
IRQ_UNLOCK(flags);
  }
  
! void quadramp_set_2nd_order_vars(struct quadramp_filter * q, uint32_t 
var_2nd_ord_pos, uint32_t var_2nd_ord_neg)
  {
uint8_t flags;
IRQ_LOCK(flags);
***
*** 71,77 
IRQ_UNLOCK(flags);
  }
  
! inline void quadramp_set_1st_order_vars(struct quadramp_filter * q, uint32_t 
var_1st_ord_pos, uint32_t var_1st_ord_neg)
  {
uint8_t flags;
IRQ_LOCK(flags);
--- 64,70 
IRQ_UNLOCK(flags);
  }
  
! void quadramp_set_1st_order_vars(struct quadramp_filter * q, uint32_t 
var_1st_ord_pos, uint32_t var_1st_ord_neg)
  {
uint8_t flags;
IRQ_LOCK(flags);


-
aversive/modules/base/math/fixed_point/f16_sqrt.c  (1.5.4.1 - 1.5.4.2)
-

***
*** 15,21 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: f16_sqrt.c,v 1.5.4.1 2006-11-26 21:06:01 zer0 Exp $
   *
   */
  
--- 15,21 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: f16_sqrt.c,v 1.5.4.2 2007-06-12 16:18:43 zer0 Exp $
   *
   */
  
***
*** 24,52 
  #include s16_to_f16.h
  
  
! /* could be optimized... */
! static inline uint16_t  u16_sqrt(uint16_t x)
! {
! uint16_t root=0x80;
! uint16_t mask=0x80;
  
! while(mask) {
! if( root*root  x ) {
! mask = 1;
! root |= mask;
! }
! else if ( root*root  x ) {
! root = ~(mask);
! mask = 1;
! root |= mask

[Avr-list] aversive CVS_LOG 2007-05-29

2007-05-28 Par sujet root
Commit from zer0 on branch b_zer0 (2007-05-28 14:43 CEST)
-

fix typo : aversive/conf to aversive_conf

  aversive  Makefile  1.35.4.5


-
aversive/Makefile  (1.35.4.4 - 1.35.4.5)
-

***
*** 99,105 
  ###
  
  mrproper:
!   find .  -name autoconf.h -o -name .aversive/conf -o -name *.hex 
-o -name *~ -o -name *.eep -o -name *.obj -o -name *.elf -o -name 
*.map -o -name *.obj -o -name *.a90 -o -name *.sym -o -name *.lnk -o 
-name *.lss -o -name *.a -o -name *.d -o -name *.o -o -name *.d -o 
-name *.lst | xargs rm -f
  
  
  .PHONY : all clean avrall avrclean hostall hostclean \
--- 99,105 
  ###
  
  mrproper:
!   find .  -name autoconf.h -o -name .aversive_conf -o -name *.hex 
-o -name *~ -o -name *.eep -o -name *.obj -o -name *.elf -o -name 
*.map -o -name *.obj -o -name *.a90 -o -name *.sym -o -name *.lnk -o 
-name *.lss -o -name *.a -o -name *.d -o -name *.o -o -name *.d -o 
-name *.lst | xargs rm -f
  
  
  .PHONY : all clean avrall avrclean hostall hostclean \


Commit from zer0 on branch b_zer0 (2007-05-28 14:55 CEST)
-

fix deprecated include files

  aversive  projects/example2/main.c  1.4.6.3


-
aversive/projects/example2/main.c  (1.4.6.2 - 1.4.6.3)
-

***
*** 15,26 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: main.c,v 1.4.6.2 2007-05-23 17:18:15 zer0 Exp $
   *
   */
  
! #include utils.h
! #include list.h
  
  #include uart.h
  
--- 15,26 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: main.c,v 1.4.6.3 2007-05-28 12:55:48 zer0 Exp $
   *
   */
  
! #include aversive.h
! #include aversive/list.h
  
  #include uart.h
  

___
Avr-list mailing list
Avr-list@droids-corp.org
CVSWEB : http://cvsweb.droids-corp.org/cgi-bin/viewcvs.cgi/aversive
WIKI : http://wiki.droids-corp.org/index.php/Aversive
DOXYGEN : http://zer0.droids-corp.org/doxygen_aversive/html/
BUGZILLA : http://bugzilla.droids-corp.org
COMMIT LOGS : http://zer0.droids-corp.org/aversive_commitlog


[Avr-list] aversive CVS_LOG 2007-03-21

2007-03-20 Par sujet root
Commit from zer0 on branch b_zer0 (2007-03-20 15:23 CET)
-

Update scheduler config

  aversive  modules/base/scheduler/scheduler_private.h1.1.2.2
  aversive  modules/base/scheduler/config/scheduler_config.h  1.1.10.3


---
aversive/modules/base/scheduler/scheduler_private.h  (1.1.2.1 - 1.1.2.2)
---

***
*** 15,27 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: scheduler_private.h,v 1.1.2.1 2007-03-05 14:41:07 zer0 
Exp $
   *
   */
  
  #ifndef _SCHEDULER_PRIVATE_H_
  #define _SCHEDULER_PRIVATE_H_
  
  #include stdint.h
  
  #include aversive_queue.h
--- 15,33 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: scheduler_private.h,v 1.1.2.2 2007-03-20 14:23:17 zer0 
Exp $
   *
   */
  
  #ifndef _SCHEDULER_PRIVATE_H_
  #define _SCHEDULER_PRIVATE_H_
  
+ #if _SCHEDULER_CONFIG_VERSION_ != 2 
+ #warning You are using an old version of scheduler_config.h file
+ #warning Look in modules/base/scheduler/config directory to import changes
+ #warning You should define SCHEDULER_NB_STACKING_MAX and SCHEDULER_CK
+ #endif
+ 
  #include stdint.h
  
  #include aversive_queue.h


-
aversive/modules/base/scheduler/config/scheduler_config.h  (1.1.10.2 - 
1.1.10.3)
-

***
*** 15,27 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: scheduler_config.h,v 1.1.10.2 2007-03-05 14:41:07 zer0 
Exp $
   *
   */
  
  #ifndef _SCHEDULER_CONFIG_H_
  #define _SCHEDULER_CONFIG_H_
  
  /** maximum number of allocated events */
  #define SCHEDULER_NB_MAX_EVENT 5
  
--- 15,30 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: scheduler_config.h,v 1.1.10.3 2007-03-20 14:23:17 zer0 
Exp $
   *
   */
  
  #ifndef _SCHEDULER_CONFIG_H_
  #define _SCHEDULER_CONFIG_H_
  
+ #define _SCHEDULER_CONFIG_VERSION_ 2
+ 
+ 
  /** maximum number of allocated events */
  #define SCHEDULER_NB_MAX_EVENT 5
  


Commit from zer0 (2007-03-20 16:22 CET)


fix adc config

  aversive  modules/hardware/adc/test/.config  1.5


--
aversive/modules/hardware/adc/test/.config  (1.4 - 1.5)
--

***
*** 59,64 
--- 59,65 
  # CONFIG_OPTM_3 is not set
  CONFIG_OPTM_S=y
  CONFIG_MATH_LIB=y
+ # CONFIG_FDEVOPEN_COMPAT is not set
  # CONFIG_MINIMAL_PRINTF is not set
  CONFIG_STANDARD_PRINTF=y
  # CONFIG_ADVANCED_PRINTF is not set
***
*** 70,76 
  # Base modules
  #
  CONFIG_MODULE_UTILS=y
- CONFIG_MODULE_UTILS_CREATE_CONFIG=y
  # CONFIG_MODULE_FIXED_POINT is not set
  # CONFIG_MODULE_VECT2 is not set
  CONFIG_MODULE_WAIT=y
--- 71,76 
***
*** 91,96 
--- 91,98 
  #
  # CONFIG_MODULE_PWM is not set
  # CONFIG_MODULE_PWM_CREATE_CONFIG is not set
+ CONFIG_MODULE_ADC=y
+ CONFIG_MODULE_ADC_CREATE_CONFIG=y
  
  #
  # IHM modules
***
*** 110,115 
--- 112,119 
  #
  # CONFIG_MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL is not set
  # CONFIG_MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL_CREATE_CONFIG is not set
+ # CONFIG_MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL_DOUBLE is not set
+ # CONFIG_MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL_DOUBLE_CREATE_CONFIG is not set
  
  #
  # Encoders (you should enable utils and fixed_point modules to see all 
available encoders)
***
*** 124,129 
--- 128,134 
  #
  # CONFIG_MODULE_ROBOT_SYSTEM is not set
  # CONFIG_MODULE_POSITION_MANAGER is not set
+ # CONFIG_MODULE_TRAJECTORY_MANAGER is not set
  
  #
  # Control system modules
***
*** 132,137 
--- 137,159 
  # CONFIG_MODULE_PID is not set
  # CONFIG_MODULE_RAMP is not set
  # CONFIG_MODULE_QUADRAMP is not set
+ # CONFIG_MODULE_QUADRAMP_DERIVATE is not set
+ # CONFIG_MODULE_BIQUAD is not set
+ 
+ #
+ # Crypto modules
+ #
+ # CONFIG_MODULE_AES is not set
+ # CONFIG_MODULE_AES_CTR is not set
+ # CONFIG_MODULE_MD5 is not set
+ # CONFIG_MODULE_MD5_HMAC is not set
+ # CONFIG_MODULE_RC4 is not set
+ 
+ #
+ # Encodings modules
+ #
+ # CONFIG_MODULE_BASE64 is not set
+ # CONFIG_MODULE_HAMMING is not set
  
  #
  # Debug modules
***
*** 142,147 
--- 164,175 
  CONFIG_MODULE_ERROR_CREATE_CONFIG=y
  
  #
+ # Programmer options
+ #
+ CONFIG_AVRDUDE=y
+ # CONFIG_AVARICE is not set
+ 
+ #
  # Avrdude
  #
  # CONFIG_AVRDUDE_PROG_FUTURELEC is not 

[Avr-list] aversive CVS_LOG 2007-03-20

2007-03-19 Par sujet root
Commit from zer0 on branch b_zer0 (2007-03-20 01:06 CET)
-

update readme with some infos

  aversive  README  1.3.10.4


---
aversive/README  (1.3.10.3 - 1.3.10.4)
---

***
*** 1,13 
! Aversive README
! ---
  
! This project is under GPL licence, and copyright Droids
! Corporation. See COPYING file at the root of the project for details.
  
! This is a development framework for AVR. You need avr-gcc suite, and
! maybe some other tools (avrdude, avarice, ...) to use it. The goal of
! this project is to provide libraries to make development on Atmel AVR
! microcontrolers easier.
  
  Once you have untared the archive (or checkouted it from the CVS), you
  can run 'make' to compile all tests programs.
--- 1,71 
! == AVERSIVE  ==
  
! Authors (see AUTHORS file for details) : 
! - Christophe RIEHL
! - Olivier MATZ
! 
! (Droids-Corporation, Microb Technology, Eirbot)
! 
! === Introduction
! 
! This is a development framework for AVR. You need avr-gcc to run
! it. The goal of this project is to provide modules to make development
! on avr easier.
! 
! Untar the archive (or checkout it from the CVS), run ./configure, it
! will generate several Makefiles (if you skip this step, the main
! Makefile will automatiquely do it for you). You can edit these files
! to customize some settings. You can now type make to compile all tests
! programs of the framework. If you want to create a new project, there
! are some examples.
  
! This is a development version, there are certainly a lot of
! bugs. Don't hesitate to tell us if you find one.
! -  avr-list@droids-corp.org
! 
! You can also have a look to our bugzilla :
! -  http://bugzilla.droids-corp.org
! 
! There's a page about this project :
! -http://wiki.droids-corp.org/mediawiki/index.php/Aversive
! 
! === The aversive source tree
! 
! config  - files related to aversive configuration
!   config/fuses_defs - fuse names and help
!   config/gen_headers- dirty scripts for generating some .h
!   config/scripts- project configuration scripts (imported 
!   from linux-2.4 kernel)
! 
! include - generic Aversive include files, that are
!   not related to a module
! 
! mk  - Aversive Makefiles (project, module, and
!   templates) 
! 
! modules - modules directory. A module is a small
!   library that provide a specific
!   functionnality
!   modules/base  - common modules, frequently used
!   modules/comm  - communication modules (uart, spi, i2c, ...)
!   modules/crypto- modules for cryptographic operations
!   modules/debug - helper modules for debugging
!   modules/devices   - modules related to a device that is not
!   part of an Atmel AVR (lcd, motors, ...)
!   modules/encoding  - buffer conversion (base64, hamming)
!   modules/hardware  - generic interfaces module for specific AVR
!   hardware (timers, ADC, ...)
!   modules/ihm   - Human-machine interface modules (menu, and
!   probably a future CLI)
! 
! projects- Project examples (to be enhanced)
!   projects/example1
!   projects/example2
! 
! 
! === Using Aversive
! 
! You need avr-gcc/avr-libc to use Aversive. 
  
  Once you have untared the archive (or checkouted it from the CVS), you
  can run 'make' to compile all tests programs.
***
*** 20,34 
  make menuconfig 
  make
  
- ---
- 
- This is a development version, there are certainly a lot of
- bugs. Don't hesitate to tell us if you find one.
- -  avr-list@droids-corp.org
- 
- You can also have a look to our bugzilla :
- -  http://bugzilla.droids-corp.org
- 
- There's a page about this project :
- -http://wiki.droids-corp.org/mediawiki/index.php/Aversive
  
--- 78,81 

___
Avr-list mailing list
Avr-list@droids-corp.org
CVSWEB : http://cvsweb.droids-corp.org/cgi-bin/viewcvs.cgi/aversive
WIKI : http://wiki.droids-corp.org/index.php/Aversive
DOXYGEN : http://zer0.droids-corp.org/doxygen_aversive/html/
BUGZILLA : http://bugzilla.droids-corp.org
COMMIT LOGS : http://zer0.droids-corp.org/aversive_commitlog


[Avr-list] aversive CVS_LOG 2007-03-13

2007-03-12 Par sujet root
Commit from zer0 on branch b_zer0 (2007-03-12 23:34 CET)
-

gh one day it will work :( :( :(

  aversive  modules/comm/mf2_server/mf2_server.c  1.1.2.3
  aversive  modules/comm/mf2_server/mf2_server.h  1.1.2.2


-
aversive/modules/comm/mf2_server/mf2_server.c  (1.1.2.2 - 1.1.2.3)
-

***
*** 15,21 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: mf2_server.c,v 1.1.2.2 2007-03-10 22:05:44 zer0 Exp $
   *
   */
  
--- 15,21 
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   *
!  *  Revision : $Id: mf2_server.c,v 1.1.2.3 2007-03-12 22:34:31 zer0 Exp $
   *
   */
  
***
*** 34,42 
  #define data_0() do { sbi(DDR(MF2_SERVER_DATA_PORT), MF2_SERVER_DATA_BIT); } 
while(0)
  #define read_data() (bit_is_set(PIN(MF2_SERVER_DATA_PORT), 
MF2_SERVER_DATA_BIT))
  
! #define clk_Z() do { cbi(DDR(MF2_SERVER_CLK_PORT), 2); } while(0)
! #define clk_0() do { sbi(DDR(MF2_SERVER_CLK_PORT), 2); } while(0)
! #define read_clk() (bit_is_set(PIN(MF2_SERVER_CLK_PORT), 2))
  
  #define MF2_SERVER_STATE_READY 0
  #define MF2_SERVER_STATE_SEND  1
--- 34,42 
  #define data_0() do { sbi(DDR(MF2_SERVER_DATA_PORT), MF2_SERVER_DATA_BIT); } 
while(0)
  #define read_data() (bit_is_set(PIN(MF2_SERVER_DATA_PORT), 
MF2_SERVER_DATA_BIT))
  
! #define clk_Z() do { cbi(DDR(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT); } 
while(0)
! #define clk_0() do { sbi(DDR(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT); } 
while(0)
! #define read_clk() (bit_is_set(PIN(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT))
  
  #define MF2_SERVER_STATE_READY 0
  #define MF2_SERVER_STATE_SEND  1
***
*** 49,58 
  static event * rx_event = NULL;
  static volatile uint8_t mf2_step=0;
  static volatile uint8_t mf2_parity_cpt=0;
! static volatile char mf2_data=0;
  
  
! #define WAIT_KBD_CYCLE 800
  #define WAIT_KBD_CYCLE4 WAIT_KBD_CYCLE/4
  
  
--- 49,59 
  static event * rx_event = NULL;
  static volatile uint8_t mf2_step=0;
  static volatile uint8_t mf2_parity_cpt=0;
! static volatile char mf2_data_send=0;
! static volatile char mf2_data_recv=0;
  
  
! #define WAIT_KBD_CYCLE 600
  #define WAIT_KBD_CYCLE4 WAIT_KBD_CYCLE/4
  
  
***
*** 114,137 
return (mf2_state==MF2_SERVER_STATE_READY  mf2_server_bus_free());
  }
  
  void mf2_server_timer_cb(void)
  {
  /*static uint16_t i=0; */

/* if it is just polling */
if (mf2_state == MF2_SERVER_STATE_READY) {
/* nothing to do if bus is free */
!   if (mf2_server_bus_free()) {
/* reload timer */
timer1A_register_OC_intr_at_tics(mf2_server_timer_cb, 
timer1_get()+MF2_SERVER_READ_POLL_PERIOD);
return;
}
else {
mf2_state = MF2_SERVER_STATE_RECV;
mf2_step = 1;
-   clk_Z();
-   data_Z();
timer1A_register_OC_intr_at_tics(mf2_server_timer_cb, 
timer1_get()+MF2_SERVER_CLK_HALF_PERIOD);
return;
}
}
--- 115,154 
return (mf2_state==MF2_SERVER_STATE_READY  mf2_server_bus_free());
  }
  
+ /* a virer XXX */
+ void disp(char c);
+ 
+ static inline void dump(void)
+ {
+   char c=0;
+   if(read_data()) 
+   c=1;
+   if(read_clk()) 
+   c|=0x10;
+   disp((char)(c));
+ }
+ 
  void mf2_server_timer_cb(void)
  {
  /*static uint16_t i=0; */

/* if it is just polling */
if (mf2_state == MF2_SERVER_STATE_READY) {
+   clk_Z();
+   data_Z();
+ 
/* nothing to do if bus is free */
!   if (!read_clk() || read_data()) {
/* reload timer */
timer1A_register_OC_intr_at_tics(mf2_server_timer_cb, 
timer1_get()+MF2_SERVER_READ_POLL_PERIOD);
return;
}
+   /* the central server has something to say */
else {
mf2_state = MF2_SERVER_STATE_RECV;
mf2_step = 1;
timer1A_register_OC_intr_at_tics(mf2_server_timer_cb, 
timer1_get()+MF2_SERVER_CLK_HALF_PERIOD);
+   dump();
return;
}
}
***
*** 141,155 
/* reload timer */
timer1A_register_OC_intr_at_tics(mf2_server_timer_cb, 
timer1_get()+MF2_SERVER_CLK_HALF_PERIOD);
  
if (mf2_state == MF2_SERVER_STATE_RECV) {
-   /* XXX not correct */
switch(mf2_step) 

[Avr-list] aversive CVS_LOG 2007-01-26

2007-01-25 Par sujet root
Commit from enseirb on branch eirbot (2007-01-25 14:21 CET)


Add unioc encoders to config

  aversive  config/config.in 1.27.4.5
  aversive  config/generate_aversive_config  1.17.4.5


-
aversive/config/config.in  (1.27.4.4 - 1.27.4.5)
-

***
*** 261,267 
  dep_bool ' Create Default encoders_eirbot config' 
CONFIG_MODULE_ENCODERS_EIRBOT_CREATE_CONFIG \
$CONFIG_MODULE_ENCODERS_EIRBOT
  
! endmenu # (encoders)
  
  mainmenu_option next_comment
  comment 'Robot specific modules'
--- 261,275 
  dep_bool ' Create Default encoders_eirbot config' 
CONFIG_MODULE_ENCODERS_EIRBOT_CREATE_CONFIG \
$CONFIG_MODULE_ENCODERS_EIRBOT
  
!  ENCODERS
! dep_bool 'Encoders (eirbot 2K7 UNIOC)' CONFIG_MODULE_ENCODERS_EIRBOT_2K7 \
!   $CONFIG_MODULE_UTILS \
!   $CONFIG_MODULE_WAIT \
! 
! dep_bool ' Create Default encoders_eirbot_2K7 config' 
CONFIG_MODULE_ENCODERS_EIRBOT_2K7_CREATE_CONFIG \
!   $CONFIG_MODULE_ENCODERS_EIRBOT_2K7
! 
! endmenu # (encoders )
  
  mainmenu_option next_comment
  comment 'Robot specific modules'



aversive/config/generate_aversive_config  (1.17.4.4 - 1.17.4.5)


***
*** 17,22 
--- 17,23 
CONFIG_MODULE_MULTISERVO,devices/servo/multiservo
CONFIG_MODULE_ENCODERS_MICROB,devices/encoders/encoders_microb
CONFIG_MODULE_ENCODERS_EIRBOT,devices/encoders/encoders_eirbot
+   
CONFIG_MODULE_ENCODERS_EIRBOT_2K7,devices/encoders/encoders_eirbot_2k7

CONFIG_MODULE_TRAJECTORY_MANAGER,devices/robot/trajectory_manager
CONFIG_MODULE_CHECKPOINT,devices/robot/checkpoint
CONFIG_MODULE_ROBOT_SYSTEM,devices/robot/robot_system


Commit from enseirb on branch eirbot (2007-01-25 14:24 CET)


Add unioc encoders

+ aversive  modules/devices/encoders/encoders_eirbot_2k7/Makefile   
1.1.2.1
+ aversive  modules/devices/encoders/encoders_eirbot_2k7/encoders_eirbot_2k7.c  
1.1.2.1
+ aversive  modules/devices/encoders/encoders_eirbot_2k7/encoders_eirbot_2k7.h  
1.1.2.1


--
aversive/modules/devices/encoders/encoders_eirbot_2k7/Makefile  (1.1.2.1)
--

***
*** 0 
--- 1,6 
+ TARGET = encoders_eirbot_2k7
+ 
+ # List C source files here. (C dependencies are automatically generated.)
+ SRC = encoders_eirbot_2k7.c
+ 
+ include $(AVERSIVE_DIR)/mk/aversive_module.mk


---
aversive/modules/devices/encoders/encoders_eirbot_2k7/encoders_eirbot_2k7.c  
(1.1.2.1)
---

***
*** 0 
--- 1,88 
+ /*  
+  *  Copyright Droids Corporation, Microb Technology, Eirbot (2005)
+  * 
+  *  This program is free software; you can redistribute it and/or modify
+  *  it under the terms of the GNU General Public License as published by
+  *  the Free Software Foundation; either version 2 of the License, or
+  *  (at your option) any later version.
+  *
+  *  This program 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 General Public License for more details.
+  *
+  *  You should have received a copy of the GNU General Public License
+  *  along with this program; if not, write to the Free Software
+  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  *
+  *  Revision : $Id: encoders_eirbot_2k7.c,v 1.1.2.1 2007-01-25 13:24:29 
enseirb Exp $
+  *
+  */
+ 
+ /** \file encoders_eirbot_2k7b.c
+  *  \brief achieves acess to incremental encoders managed by a FPGA and 
accessed via external ram interface
+  *
+  *  \todo nothing !
+  *
+  *  \test  
+  *
+  *  this modules reads 8 bit encoders values on an external interface.
+  *  there are two necessary busses with the interface logic: 8 bit data bus 
and a n bits selection bus.
+  *  ( see the VDHL for the xilinx program)
+  *  with n bits on the selection bus, you can acess to 2^n encoderss.
+  *
+  *  modifié par lamygale le 10 octobre 2005. d'apres le code 2004 du codeur
+  *
+  */
+ 
+ 
+ 
+ #include utils.h
+ 
+ 
+ #include encoders_eirbot_2k7.h
+ 
+ #include encoders_eirbot_2k7_config.h
+ 
+ /**
+  * fonction utilisée 2 fois seulement, acquiert un codeur
+ */
+ inline int32_t get_encoder(uint8_t num)
+ {
+   int32_t val;
+   uint8_t *reg;
+   uint8_t flags;
+   
+   // calcul de l'adresse de base des 4 registres conservant la valeur 
codeur
+   reg = (uint16_t)BASE_ADRESS_ENCODERS + 4* 

[Avr-list] aversive CVS_LOG 2007-01-10

2007-01-09 Par sujet root
Commit from tof on branch b_tof (2007-01-09 20:36 CET)
---

adding quadramp derivate

  aversive  config/Configure.help   
 1.13.2.4
  aversive  config/config.in
 1.42.2.4
  aversive  config/generate_aversive_config 
 1.23.2.4
+ aversive  modules/devices/control_system/filters/quadramp_derivate/Makefile   
 1.1.2.1
+ aversive  
modules/devices/control_system/filters/quadramp_derivate/quadramp_derivate.c
 1.1.2.1
+ aversive  
modules/devices/control_system/filters/quadramp_derivate/quadramp_derivate.h
 1.1.2.1
+ aversive  
modules/devices/control_system/filters/quadramp_derivate/test/Makefile  
 1.1.2.1
+ aversive  
modules/devices/control_system/filters/quadramp_derivate/test/brushless_3phase_digital_hall_double_config.h
  1.1.2.1
+ aversive  
modules/devices/control_system/filters/quadramp_derivate/test/error_config.h
 1.1.2.1
+ aversive  
modules/devices/control_system/filters/quadramp_derivate/test/main.c
 1.1.2.1
+ aversive  
modules/devices/control_system/filters/quadramp_derivate/test/pwm_config.h  
 1.1.2.1
+ aversive  
modules/devices/control_system/filters/quadramp_derivate/test/time_config.h 
 1.1.2.1
+ aversive  
modules/devices/control_system/filters/quadramp_derivate/test/uart_config.h 
 1.1.2.1
+ aversive  
modules/devices/control_system/filters/quadramp_derivate/test/utils_config.h
 1.1.2.1


--
aversive/config/Configure.help  (1.13.2.3 - 1.13.2.4)
--

***
*** 187,192 
--- 187,199 
system as a consign filter to specify a maximum acceleration and a 
maximum speed.
  
+ CONFIG_MODULE_QUADRAMP_DERIVATE
+   This module generates the same kind of ramp than the quadramp.
+   however here we generate the derivate of this ramp, which is a speed
+   consign which can be fed to a speed PID.
+   The advantages are less computation (no square root), and a better
+   robustness against blocking.
+ 
  CONFIG_MODULE_BIQUAD
This module is a general digital filter. It is very useful for all
filtering purposes, not only for control loops. You can implement
***
*** 238,245 
saving the configuration. This script uses avrdude to program the
fuse value of your target device. NOT IMPLEMENTED YET.
  
  CONFIG_MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL
This module drives a 3-phase synchronous motor (called brushless)
This is done with 3 hall sensors who give the position of the rotor.
The controller polls these sensors, and updates 3 PWM outputs to drive
!   the 3 phases.
\ No newline at end of file
--- 245,260 
saving the configuration. This script uses avrdude to program the
fuse value of your target device. NOT IMPLEMENTED YET.
  
+ 
  CONFIG_MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL
This module drives a 3-phase synchronous motor (called brushless)
This is done with 3 hall sensors who give the position of the rotor.
The controller polls these sensors, and updates 3 PWM outputs to drive
!   the 3 phases.
! 
! CONFIG_MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL_DOUBLE
!   This is a double implementation of the MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL
!   This module drives two 3-phase synchronous motor (called brushless)
!   This is done with 3 hall sensors who give the position of the rotor.
!   The controller polls these sensors, and updates 3 PWM outputs to drive
!   the 3 phases of each motor
\ No newline at end of file


-
aversive/config/config.in  (1.42.2.3 - 1.42.2.4)
-

***
*** 183,193 
  
  
   ADC (not yet)
! # dep_bool 'ADC' CONFIG_MODULE_ADC \
! # $CONFIG_MODULE_UTILS
  
! # dep_bool ' Create Default adc config' CONFIG_MODULE_ADC_CREATE_CONFIG \
! # $CONFIG_MODULE_ADC
  
  endmenu
  
--- 183,193 
  
  
   ADC (not yet)
! dep_bool 'ADC' CONFIG_MODULE_ADC \
!   $CONFIG_MODULE_UTILS
  
!  dep_bool ' Create Default adc config' CONFIG_MODULE_ADC_CREATE_CONFIG \
!   $CONFIG_MODULE_ADC
  
  endmenu
  
***
*** 232,237 
--- 232,245 
  dep_bool ' Create Default brushless_3phase_digital_hall config' 
CONFIG_MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL_CREATE_CONFIG \
$CONFIG_MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL
  
+  CONFIG_MODULE_BRUSHLESS_3PHASE_DIGITAL_HALL_DOUBLE
+ dep_bool 'two 3 phase motor with digital hall sensors