Commit 70b082c8 authored by Benjamin Vedder's avatar Benjamin Vedder

Made the code build with the C89 standard and changed to tickless kernel mode

parent 25f80168
......@@ -5,7 +5,7 @@
# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
......
......@@ -109,6 +109,7 @@ void bldc_interface_process_packet(unsigned char *data, unsigned int len) {
}
int32_t ind = 0;
int i = 0;
unsigned char id = data[0];
data++;
len--;
......@@ -304,7 +305,7 @@ void bldc_interface_process_packet(unsigned char *data, unsigned int len) {
ind = 0;
detect_cycle_int_limit = buffer_get_float32(data, 1000.0, &ind);
detect_coupling_k = buffer_get_float32(data, 1000.0, &ind);
for (int i = 0;i < 8;i++) {
for (i = 0;i < 8;i++) {
detect_hall_table[i] = (const signed char)(data[ind++]);
}
detect_hall_res = (const signed char)(data[ind++]);
......
......@@ -59,7 +59,7 @@
* The value one is not valid, timeouts are rounded up to
* this value.
*/
#define CH_CFG_ST_TIMEDELTA 0
#define CH_CFG_ST_TIMEDELTA 2
/** @} */
......@@ -82,7 +82,7 @@
* @note The round robin preemption is not supported in tickless mode and
* must be set to zero in that case.
*/
#define CH_CFG_TIME_QUANTUM 4
#define CH_CFG_TIME_QUANTUM 0
/**
* @brief Managed RAM size.
......
......@@ -80,7 +80,8 @@ void packet_send_packet(unsigned char *data, unsigned int len, int handler_num)
* Call this function every millisecond.
*/
void packet_timerfunc(void) {
for (int i = 0;i < PACKET_HANDLERS;i++) {
int i = 0;
for (i = 0;i < PACKET_HANDLERS;i++) {
if (handler_states[i].rx_timeout) {
handler_states[i].rx_timeout--;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment