Commit Graph

17 Commits

Author SHA1 Message Date
Jim Mussared
94beeabd2e py/obj: Convert make_new into a mp_obj_type_t slot.
Instead of being an explicit field, it's now a slot like all the other
methods.

This is a marginal code size improvement because most types have a make_new
(100/138 on PYBV11), however it improves consistency in how types are
declared, removing the special case for make_new.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-19 19:06:15 +10:00
Jim Mussared
9dce82776d all: Remove unnecessary locals_dict cast.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-19 19:06:01 +10:00
Jim Mussared
662b9761b3 all: Make all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE.
In preparation for upcoming rework of mp_obj_type_t layout.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-19 19:06:01 +10:00
Damien George
59dbbe9be7 esp32: Fix use of mp_int_t, size_t and uintptr_t.
Signed-off-by: Damien George <damien@micropython.org>
2021-07-18 23:58:16 +10:00
Damien George
136369d72f all: Update to point to files in new shared/ directory.
Signed-off-by: Damien George <damien@micropython.org>
2021-07-12 17:08:10 +10:00
Damien George
1dc64359da esp32: Use path relative to root for netutils/timeutils headers.
Signed-off-by: Damien George <damien@micropython.org>
2020-10-06 12:32:20 +11:00
Damien George
8f20cdc353 all: Rename absolute time-based functions to include "epoch".
For time-based functions that work with absolute time there is the need for
an Epoch, to set the zero-point at which the absolute time starts counting.
Such functions include time.time() and filesystem stat return values.  And
different ports may use a different Epoch.

To make it clearer what functions use the Epoch (whatever it may be), and
make the ports more consistent with their use of the Epoch, this commit
renames all Epoch related functions to include the word "epoch" in their
name (and remove references to "2000").

Along with this rename, the following things have changed:

- mp_hal_time_ns() is now specified to return the number of nanoseconds
  since the Epoch, rather than since 1970 (but since this is an internal
  function it doesn't change anything for the user).

- littlefs timestamps on the esp8266 have been fixed (they were previously
  off by 30 years in nanoseconds).

Otherwise, there is no functional change made by this commit.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-18 17:20:34 +10:00
Jim Mussared
def76fe4d9 all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
Damien George
1a3e386c67 all: Remove spaces inside and around parenthesis.
Using new options enabled in the uncrustify configuration.
2020-03-28 23:36:44 +11:00
Damien George
feb2577585 all: Remove spaces between nested paren and inside function arg paren.
Using new options enabled in the uncrustify configuration.
2020-03-25 00:39:46 +11:00
Damien George
69661f3343 all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-28 10:33:03 +11:00
Josh Lloyd
1530fda9cf esp32/machine_rtc: Reduce memory footprint of user mem functionality. 2019-11-21 16:55:12 +11:00
Josh Lloyd
ed2314f35a esp32/machine_rtc: Make RTC.memory size and availability configurable.
The compile-time configuration value MICROPY_HW_RTC_USER_MEM_MAX can now be
used to define the amount of memory set aside for RTC.memory().  If this
value is configured to zero then the RTC.memory functionality is not
included in the build.
2019-11-21 16:55:12 +11:00
Josh Lloyd
82d358510b esp32/rtc: Set system microseconds when setting time via RTC.datetime(). 2019-11-13 13:46:33 +11:00
Damien George
185716514f esp32/machine_rtc: Fix locals dict entry, init qstr points to init meth. 2018-09-20 17:52:16 +10:00
Damien George
4fa7d36cee esp32: Use mp_rom_map_elem_t and MP_ROM_xxx macros for const dicts. 2018-05-02 22:33:41 +10:00
Eric Poulsen
44033a1d27 esp32/machine_rtc: Add RTC class to machine module with sleep impl.
The machine.RTC class is added and the machine module is updated with the
implementation of sleep, deepsleep, reset_cause and wake_reason.
2018-02-17 00:47:17 +11:00