Commit from zer0 on branch b_zer0 (2009-03-17 19:50 CET)
=================================
if period givent to scheduler is 0, return an error (instead
of scheduling a very long event)
aversive modules/base/scheduler/scheduler_add.c 1.1.2.3
===============================================
aversive/modules/base/scheduler/scheduler_add.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_add.c,v 1.1.2.2 2007-05-23 17:18:11 zer0 Exp $
+ * Revision : $Id: scheduler_add.c,v 1.1.2.3 2009-03-17 18:50:49 zer0 Exp $
*
*/
@@ -48,16 +48,19 @@
* return its index in the table, or -1 if no evt is available */
int8_t
scheduler_add_event(uint8_t unicity, void (*f)(void *),
- void * data, uint16_t period,
+ void *data, uint16_t period,
uint8_t priority) {
int8_t i;
uint8_t flags;
+ if (period == 0)
+ return -1;
+
i = scheduler_alloc_event();
if ( i == -1 )
return -1;
- if(!unicity)
+ if (!unicity)
g_tab_event[i].period = period ;
else
g_tab_event[i].period = 0 ;
Commit from zer0 on branch b_zer0 (2009-03-17 19:51 CET)
=================================
init the spi encoders correctly: if the previous CPLD value is
not 0, consider this as the new offset.
aversive modules/devices/encoders/encoders_spi/encoders_spi.c 1.1.2.2
=============================================================
aversive/modules/devices/encoders/encoders_spi/encoders_spi.c (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: encoders_spi.c,v 1.1.2.1 2009-02-20 20:24:21 zer0 Exp $
+ * Revision : $Id: encoders_spi.c,v 1.1.2.2 2009-03-17 18:51:55 zer0 Exp $
*
* Olivier MATZ <[email protected]>
*/
@@ -41,11 +41,12 @@
/* Initialisation of encoders, variables */
void encoders_spi_init(void)
{
- memset(g_encoders_spi_values, 0, sizeof(g_encoders_spi_values));
memset(g_encoders_spi_previous, 0, sizeof(g_encoders_spi_previous));
spi_register_ss_line(&ENCODERS_SPI_SS_PORT, ENCODERS_SPI_SS_BIT);
spi_init(SPI_MODE_MASTER, ENCODERS_SPI_FORMAT, ENCODERS_SPI_CLK_RATE);
spi_set_data_order(ENCODERS_SPI_DATA_ORDER);
+ encoders_spi_manage(NULL);
+ memset(g_encoders_spi_values, 0, sizeof(g_encoders_spi_values));
}
_______________________________________________
Avr-list mailing list
[email protected]
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