summaryrefslogtreecommitdiff
path: root/extmod/modutimeq.c
AgeCommit message (Collapse)Author
2020-04-23all: Format code to add space after C++-style comment start.stijn
Note: the uncrustify configuration is explicitly set to 'add' instead of 'force' in order not to alter the comments which use extra spaces after // as a means of indenting text for clarity.
2020-04-05all: Use MP_ERROR_TEXT for all error messages.Jim Mussared
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2019-11-05all: Convert nlr_raise(mp_obj_new_exception_msg(x)) to mp_raise_msg(x).Damien George
This helper function was added a while ago and these are the remaining cases to convert, to save a bit of code size.
2019-08-20extmod: Give vars/funcs unique names so STATIC can be set to nothing.Damien George
Fixes issue #5018.
2019-02-12extmod: Convert legacy uppercase macro names to lowercase.Damien George
2017-10-24all: Use NULL instead of "" when calling mp_raise exception helpers.Damien George
This is the established way of doing it and reduces code size by a little bit.
2017-10-04all: Remove inclusion of internal py header files.Damien George
Header files that are considered internal to the py core and should not normally be included directly are: py/nlr.h - internal nlr configuration and declarations py/bc0.h - contains bytecode macro definitions py/runtime0.h - contains basic runtime enums Instead, the top-level header files to include are one of: py/obj.h - includes runtime0.h and defines everything to use the mp_obj_t type py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h, and defines everything to use the general runtime support functions Additional, specific headers (eg py/objlist.h) can be included if needed.
2017-08-29all: Convert mp_uint_t to mp_unary_op_t/mp_binary_op_t where appropriateDamien George
The unary-op/binary-op enums are already defined, and there are no arithmetic tricks used with these types, so it makes sense to use the correct enum type for arguments that take these values. It also reduces code size quite a bit for nan-boxing builds.
2017-03-29modutimeq: Add peektime() function (provisional).Jan Pochyla
Allows to get event time for a head item in the queue. The usecase if waiting for the next event *OR* I/O completion. I/O completion may happen before event triggers, and then wait should continue for the remaining event time (or I/O completion may schedule another earlier event altogether). The new function has a strongly provisional status - it may be converted to e.g. peek() function returning all of the event fields, not just time.
2017-03-07extmod/modutimeq: Make scheduling fair (round-robin).Paul Sokolovsky
By adding back monotonically increasing field in addition to time field. As heapsort is not stable, without this, among entried added and readded at the same time instant, some might be always selected, and some might never be selected, leading to scheduling starvation.
2016-12-24extmod/modutimeq: Make time_less_than be actually "less than", not less/eq.Paul Sokolovsky
This fixes an obvious case of non-fair scheduling of 2 tasks with the same deadline.
2016-12-23extmod/modutimeq: Fix printf in dump().Paul Sokolovsky
2016-12-22extmod/modutimeq: Fix warning about unused param.Paul Sokolovsky
2016-12-22extmod/modutimeq: Refactor into optimized class.Paul Sokolovsky
import utimeq, utime # Max queue size, the queue allocated statically on creation q = utimeq.utimeq(10) q.push(utime.ticks_ms(), data1, data2) res = [0, 0, 0] # Items in res are filled up with results q.pop(res)
2016-12-22extmod/modutimeq: Copy of current moduheapq with timeq support for refactoring.Paul Sokolovsky