| 72 | } |
| 73 | |
| 74 | static rt_bool_t rt_tick_timeout(rt_tick_t tick_start, rt_tick_t tick_long) |
| 75 | { |
| 76 | rt_tick_t tick_end = tick_start + tick_long; |
| 77 | rt_tick_t tick_now = rt_tick_get(); |
| 78 | rt_bool_t result = RT_FALSE; |
| 79 | |
| 80 | if (tick_end >= tick_start) |
| 81 | { |
| 82 | if (tick_now >= tick_end) |
| 83 | { |
| 84 | result = RT_TRUE; |
| 85 | } |
| 86 | else |
| 87 | { |
| 88 | result = RT_FALSE; |
| 89 | } |
| 90 | } |
| 91 | else |
| 92 | { |
| 93 | if ((tick_now < tick_start) && (tick_now >= tick_end)) |
| 94 | { |
| 95 | result = RT_TRUE; |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | result = RT_FALSE; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | return result; |
| 104 | } |
| 105 | |
| 106 | static uint8_t crc7(const uint8_t *buf, int len) |
| 107 | { |
no test coverage detected