X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fkernel%2Fao_log.c;fp=src%2Fkernel%2Fao_log.c;h=40a96ef7f259fa4811d6faa11c9567fbd323b6ec;hb=a4202b4180e77e2a39ca071d3b8b8256ff0fc7b5;hp=dc3b6486caabea5355753cea8e446fd1eb213dac;hpb=aa7dd289ee72f7a49a08ce0229c4e0e0404499d0;p=fw%2Faltos diff --git a/src/kernel/ao_log.c b/src/kernel/ao_log.c index dc3b6486..40a96ef7 100644 --- a/src/kernel/ao_log.c +++ b/src/kernel/ao_log.c @@ -192,12 +192,14 @@ ao_log_find_max_erase_flight(void) __reentrant ao_flight_number = 1; } -void +uint8_t ao_log_scan(void) __reentrant { uint8_t log_slot; uint8_t log_slots; -#if !FLIGHT_LOG_APPEND +#if FLIGHT_LOG_APPEND + uint8_t ret; +#else uint8_t log_want; #endif @@ -248,9 +250,13 @@ ao_log_scan(void) __reentrant empty = ao_log_current_pos; } } + ret = 1; } else { ao_log_find_max_erase_flight(); + ret = 0; } + ao_wakeup(&ao_flight_number); + return ret; #else if (ao_flight_number) @@ -278,8 +284,9 @@ ao_log_scan(void) __reentrant if (++log_slot >= log_slots) log_slot = 0; } while (log_slot != log_want); -#endif ao_wakeup(&ao_flight_number); + return 0; +#endif } void