diff --git a/source/firmware/arch/stm32f4xx/syscalls.c b/source/firmware/arch/stm32f4xx/syscalls.c index 180bda2..aa627e4 100755 --- a/source/firmware/arch/stm32f4xx/syscalls.c +++ b/source/firmware/arch/stm32f4xx/syscalls.c @@ -79,41 +79,29 @@ caddr_t _sbrk(int incr) int _close(int file) { - file = file; /* avoid warning */ return -1; } int _fstat(int file, struct stat *st) { - file = file; /* avoid warning */ st->st_mode = S_IFCHR; return 0; } int _isatty(int file) { - file = file; /* avoid warning */ return 1; } int _lseek(int file, int ptr, int dir) { - file = file; /* avoid warning */ - ptr = ptr; /* avoid warning */ - dir = dir; /* avoid warning */ return 0; } int _read(int file, char *ptr, int len) { - file = file; /* avoid warning */ - ptr = ptr; /* avoid warning */ - len = len; /* avoid warning */ return 0; } int _write(int file, char *ptr, int len) { - int todo = todo; - file = file; /* avoid warning */ -// USB_VCOM_Send(ptr, len); return len; } diff --git a/source/firmware/kernel/driver/cc110x.c b/source/firmware/kernel/driver/cc110x.c index 6f5a5a7..63aa5a0 100755 --- a/source/firmware/kernel/driver/cc110x.c +++ b/source/firmware/kernel/driver/cc110x.c @@ -103,11 +103,10 @@ int cc110x_write(const struct cc110x *cc110x, const char *buffer, int cc110x_read(const struct cc110x *cc110x, char *buffer, int size) { int ret; - unsigned int irq; if((NULL == cc110x) || (NULL == buffer)) return (-1); if(0 == cc110x_get_rx_count(cc110x)) { - irq = disable_irq(); + unsigned int irq = disable_irq(); current_thread->status = THREAD_STATUS_BLOCKING; current_thread->wakeup_blocking_source = (void*) cc110x; restore_irq(irq); diff --git a/source/firmware/kernel/driver/ssd1306.c b/source/firmware/kernel/driver/ssd1306.c index e045378..5bf62b2 100644 --- a/source/firmware/kernel/driver/ssd1306.c +++ b/source/firmware/kernel/driver/ssd1306.c @@ -101,7 +101,7 @@ int ssd1306_open(const struct ssd1306 *dev) { int ret; ret = i2c_open((struct i2c *)dev->dev); - ret = i2c_write(dev->dev, dev->i2c_addr, init_sequence, + ret |= i2c_write(dev->dev, dev->i2c_addr, init_sequence, sizeof(init_sequence) / sizeof(init_sequence[0])); ret |= clear(dev); ret |= set_column(dev, 0); diff --git a/source/firmware/kernel/thread.c b/source/firmware/kernel/thread.c index 60ab76d..f6556af 100644 --- a/source/firmware/kernel/thread.c +++ b/source/firmware/kernel/thread.c @@ -108,8 +108,6 @@ struct thread_context *thread_create( return NULL; thread->pid = threads.count; - if(thread->pid < 0) - return NULL; thread->stack = stack; thread->stack_size = stack_size; thread->sp = stack_init(thread_func, arg, stack, stack_size);