Project

General

Profile

Revision 318

Analog out of bounds memory access error fixed.

View differences:

dragonfly_lib.c
64 64
 **/
65 65
void dragonfly_init(int config) 
66 66
{
67
		sei();
67
	sei();
68 68

  
69 69
	// Set directionality of various IO pins
70 70
	DDRG &= ~(_BV(PING0)|_BV(PING1));
......
108 108
	_delay_ms(1);
109 109
}
110 110

  
111
/**
112
 * Malloc for colony. Disables analog loop and then restarts it
113
 * to avoid problems with malloc.
114
 *
115
 * @param size the number of bytes to allocate
116
 * @return a pointer to size bytes of allocated memory
117
 **/
118
inline void* colony_malloc(int size)
119
{
120
	void* ret = NULL;
121
	analog_stop_loop();
122
	delay_ms(1000);
123
	cli();
124
	usb_puts("Calling malloc!\n");
125
	ret = malloc(size);
126
	usb_puts("Malloc returned!\n");
127
	sei();
128
	analog_start_loop();
129
	return ret;
130
}
111 131

  
132

  
112 133
/** @} **/ //end defgroup
113 134

  

Also available in: Unified diff