mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys: Misc errors that occur w/ ENABLE_DEBUG fixed
I enabled debug output in all files to poke around and there were some errors (seemingly) due to code changes that were not tested with debug enabled. This commits tries to fix these issues.
This commit is contained in:
parent
aa639486e2
commit
8e758d7463
@ -107,7 +107,7 @@ void chardev_loop(ringbuffer_t *rb)
|
||||
DEBUG("Data is available\n");
|
||||
unsigned state = disableIRQ();
|
||||
int nbytes = min(r->nbytes, rb->avail);
|
||||
DEBUG("uart0_thread [%i]: sending %i bytes received from %" PRIkernel_pid " to pid %" PRIkernel_pid "\n", pid, nbytes, m.sender_pid, reader_pid);
|
||||
DEBUG("uart0_thread [%i]: sending %i bytes received from %" PRIkernel_pid " to pid %" PRIkernel_pid "\n", thread_getpid(), nbytes, m.sender_pid, reader_pid);
|
||||
ringbuffer_get(rb, r->buffer, nbytes);
|
||||
r->nbytes = nbytes;
|
||||
|
||||
|
@ -123,7 +123,7 @@ static inline void timex_normalize(timex_t *time)
|
||||
* @return true for a normalized timex_t
|
||||
* @return false otherwise
|
||||
*/
|
||||
static inline int timex_isnormalized(timex_t *time)
|
||||
static inline int timex_isnormalized(const timex_t *time)
|
||||
{
|
||||
return (time->microseconds < SEC_IN_USEC);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
timex_t timex_add(const timex_t a, const timex_t b)
|
||||
{
|
||||
#if ENABLE_DEBUG
|
||||
if (!timex_isnormalized(a) || !timex_isnormalized(b)) {
|
||||
if (!timex_isnormalized(&a) || !timex_isnormalized(&b)) {
|
||||
puts("timex_add on denormalized value");
|
||||
}
|
||||
#endif
|
||||
@ -53,7 +53,7 @@ timex_t timex_set(uint32_t seconds, uint32_t microseconds)
|
||||
result.microseconds = microseconds;
|
||||
|
||||
#if ENABLE_DEBUG
|
||||
if (!timex_isnormalized(result)) {
|
||||
if (!timex_isnormalized(&result)) {
|
||||
puts("timex_set on denormalized value");
|
||||
}
|
||||
#endif
|
||||
@ -64,7 +64,7 @@ timex_t timex_set(uint32_t seconds, uint32_t microseconds)
|
||||
timex_t timex_sub(const timex_t a, const timex_t b)
|
||||
{
|
||||
#if ENABLE_DEBUG
|
||||
if (!timex_isnormalized(a) || !timex_isnormalized(b)) {
|
||||
if (!timex_isnormalized(&a) || !timex_isnormalized(&b)) {
|
||||
puts("timex_sub on denormalized value");
|
||||
}
|
||||
#endif
|
||||
@ -86,7 +86,7 @@ timex_t timex_sub(const timex_t a, const timex_t b)
|
||||
int timex_cmp(const timex_t a, const timex_t b)
|
||||
{
|
||||
#if ENABLE_DEBUG
|
||||
if (!timex_isnormalized(a) || !timex_isnormalized(b)) {
|
||||
if (!timex_isnormalized(&a) || !timex_isnormalized(&b)) {
|
||||
puts("timex_cmp on denormalized value");
|
||||
}
|
||||
#endif
|
||||
|
@ -423,11 +423,11 @@ int vtimer_msg_receive_timeout(msg_t *m, timex_t timeout) {
|
||||
|
||||
#if ENABLE_DEBUG
|
||||
|
||||
void vtimer_print_short_queue(){
|
||||
void vtimer_print_short_queue(void){
|
||||
priority_queue_print(&shortterm_priority_queue_root);
|
||||
}
|
||||
|
||||
void vtimer_print_long_queue(){
|
||||
void vtimer_print_long_queue(void){
|
||||
priority_queue_print(&longterm_priority_queue_root);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user