Damien George
8dcc0c7924
py: Calculate maximum exception stack size in compiler.
11 years ago
Damien George
945a01c4e3
py: Fix bug in type_store_attr, trying to store to ROM.
11 years ago
Damien George
bdcbf0fcd1
py: Restore CPython compatibility in compiler for closures with def args.
11 years ago
Damien George
d6f9434091
Merge pull request #381 from pfalcon/closure-defargs
py: Support closures with default args.
11 years ago
Damien George
eed6f26bed
stmhal: Use rt_check_nargs to check number of arguments.
11 years ago
Damien George
f61a072f68
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
174bca7b5a
stmhal: Remove ExtiMeta object and clean up class constants.
11 years ago
Damien George
c3f1126ee8
py: Fix logic bugs in object attribute/method extraction.
11 years ago
Damien George
6022d9d478
py: Improved builtin dir.
11 years ago
Paul Sokolovsky
e9137b94f2
py: Implement getattr() builtin.
11 years ago
Damien George
9b196cddab
Remove mp_obj_type_t.methods entry and use .locals_dict instead.
Originally, .methods was used for methods in a ROM class, and
locals_dict for methods in a user-created class. That distinction is
unnecessary, and we can use locals_dict for ROM classes now that we have
ROMable maps.
This removes an entry in the bloated mp_obj_type_t struct, saving a word
for each ROM object and each RAM object. ROM objects that have a
methods table (now a locals_dict) need an extra word in total (removed
the methods pointer (1 word), no longer need the sentinel (2 words), but
now need an mp_obj_dict_t wrapper (4 words)). But RAM objects save a
word because they never used the methods entry.
Overall the ROM usage is down by a few hundred bytes, and RAM usage is
down 1 word per user-defined type/class.
There is less code (no need to check 2 tables), and now consistent with
the way ROM modules have their tables initialised.
Efficiency is very close to equivaluent.
11 years ago
Paul Sokolovsky
2447a5b582
py: Support closures with default args.
11 years ago
Damien George
c12b2213c1
Change mp_method_t.name from const char * to qstr.
Addresses issue #377 .
11 years ago
Damien George
69b3ba0df3
py: Swap around the double return value of mp_obj_gen_resume.
Just to keep things consistent :)
11 years ago
Damien George
66eaf84b8c
py: Replace mp_const_stop_iteration object with MP_OBJ_NULL.
11 years ago
Damien George
688e220d26
Merge pull request #379 from pfalcon/reraise
vm: Implement raise statement w/o args (reraising last exception).
11 years ago
Damien George
9c817b9465
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
548e76cfd6
py: Use _is_subclass_fast instead of _exception_match.
11 years ago
Damien George
752ba554cc
Merge branch 'gen-close-ret-val' of github.com:pfalcon/micropython into pfalcon-gen-close-ret-val
11 years ago
Damien George
9e6e935df0
py: Add support for user-defined iterators via __iter__, __next__.
11 years ago
Paul Sokolovsky
af1ae30399
objexcept: Add mp_obj_exception_get_value() convenience function.
This gets "value" of exceptions in the sense as it's defined for
StopIteration.value (i.e. args[0] or None).
TODO: This really should be inline function.
11 years ago
Paul Sokolovsky
c403076ef8
vm: Implement raise statement w/o args (reraising last exception).
11 years ago
Paul Sokolovsky
962b1cd1b1
objgenerator: Implement return with value and .close() method.
Return with value gets converted to StopIteration(value). Implementation
keeps optimizing against creating of possibly unneeded exception objects,
so there're considerable refactoring to implement these features.
11 years ago
Damien George
38f0c607b0
stmhal: Change Usart creation function to class make_new.
11 years ago
Damien George
3021632501
stmhal: Shuffle around some init functions in main().
11 years ago
Damien George
6cfda3084d
stmhal: Add I2C support; change accel driver to use new I2C.
11 years ago
Damien George
681d0a9ca7
Merge pull request #370 from xbe/str-rfind
py/objstr.c: Implement str.rfind() and add tests for it, refactor find_subbytes().
11 years ago
Damien George
6e628c49ca
py: Replace naive and teribble hash function with djb2.
11 years ago
Damien George
ffb5cfc8d8
py: Removed some unnecessary exception objects.
They still exist in commented-out form in objexcept.c if they are ever
needed.
11 years ago
Damien George
caac542b23
Proper support for registering builtin modules in ROM.
Comes with some refactoring of code and renaming of files. All modules
are now named mod*.[ch].
11 years ago
Damien George
1dfde891e3
Merge pull request #373 from iabdalkader/module_register
Add mp_obj_module_register
11 years ago
Damien George
24d527bf22
Merge pull request #375 from dhylands/stmhal-adc
Some changes that I forgot to push with my last pull request
11 years ago
Dave Hylands
f0729b19ad
Fix netduino to build
Fix adc to work with resolution changes.
11 years ago
Paul Sokolovsky
9512e9e817
objexcept: Add "args" exception attribute, as well as StopIteration.value.
11 years ago
Paul Sokolovsky
7f8b31345b
rt_load_method(): Add missing qstr_str() when getting type name.
11 years ago
mux
89d45248ee
Add mp_obj_module_register
* Add function to load static modules.
* Use module_register to pyb module.
11 years ago
Damien George
da5e269e51
stmhal: Make pyb.ADC the ADC class (not a function).
11 years ago
Dave Hylands
1403298a65
stmhal - fixed up adc stuff
Added support for the ADC channels and mappings to make_pins.py
I'm not sure if the hal properly deals with the channel 16/18 differences
between the 40x and 42x. It seems to deal with it partially. This particular
aspect will need testing on a 42x or 43x.
11 years ago
Damien George
6609d636d0
stmhal: Add comment to DAC driver for function to implement.
11 years ago
Damien George
b13492f8ad
stmhal: Add DAC driver.
11 years ago
Damien George
840efe0661
Update README.
11 years ago
Damien George
41ea651839
Add tools/pyboard.py, a simple module to communicate with the pyboard.
Using pyboard.py you can use Python running on your PC to execute
commands on the connected pyboard. See examples in that file.
11 years ago
Damien George
f704e7f20e
stmhal: Improve REPL CTRL commands.
11 years ago
Damien George
2f8beb8d88
stmhal: Fix bug with USB CDC transmit buffer wrap around.
11 years ago
Damien George
a82d7ef29d
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
0e9d96f18f
stmhal: Make Led, Servo and Accel their class, not a function.
11 years ago
Damien George
5fd2ebbbdd
stmhal: Update help function.
11 years ago
Damien George
24ff063e80
py: Remove obsolete declarations; make mp_obj_get_array consistent.
11 years ago
xbe
17a5a83fb4
Implement str.rfind() and add tests for it.
11 years ago
xbe
8562de6c48
py/objstr.c: Remove done TODOs.
11 years ago