Émilie Feral
37061b9cb5
[python] Fix gc_collect to be sure to get unaligned pointers
2020-02-12 15:13:16 +01:00
Émilie Feral
4b58efbc0a
[python] Fix stack boundary on the device
2020-02-12 15:13:16 +01:00
Émilie Feral
d1e93a2918
[python] Python stack: fix limit
2020-02-12 15:13:16 +01:00
Ruben Dashyan
389fbbca3a
[python/port] Support for unicode strings
2020-01-06 15:15:19 +01:00
Émilie Feral
070d362f15
[python] Improve comment
2019-12-12 14:16:13 +01:00
Émilie Feral
49aa58446b
[python] modkandinsky: fill_rect and draw_string calls might take some
...
time. As "micropython_port_vm_hook_loop" is not called while we are
executing module code, we add an extra check for user interruption in
module functions.
2019-12-04 11:27:32 +01:00
Émilie Feral
0db66f1784
[python] Turtle: add TODO
2019-12-04 11:27:32 +01:00
Émilie Feral
59b6dbd74e
[python] micropython_port_interruptible_msleep should always call micropython_port_interrupt_if_needed even if the delay is small
2019-12-04 11:27:32 +01:00
Romain Goyet
7607c4cba4
[python/modion] Use constants to identify keys
2019-11-19 10:08:16 +01:00
Romain Goyet
9d66b23848
[python] Add an ion module
2019-11-19 10:08:16 +01:00
Léa Saviot
577e7db8dd
[python/port] Use msleep (not millis) in micropython_port_interruptible_msleep
2019-10-15 16:06:34 +02:00
Léa Saviot
c421cf709d
[python] Generated moduledefs.h file
2019-08-21 11:13:13 +02:00
Léa Saviot
ff833536dd
[python] Clean and update port/genhdr/qstrdefs.in.h
2019-08-21 10:58:26 +02:00
Léa Saviot
0975ba0f10
[python] Upgrade to micropython 1.11
2019-08-21 10:58:12 +02:00
Léa Saviot
a450ce3855
Merge branch 'master' into f7
2019-08-06 17:40:14 +02:00
Léa Saviot
95403c8a91
[python/port] Increase stack limit on emscripten, simulator...
...
The value is quite arbitrary, we just do not want to outperfom the
device but still provide more recursion depth.
2019-06-25 08:37:47 -04:00
Émilie Feral
d07b3382e9
Merge branch 'master' into f7
2019-06-14 13:38:02 -04:00
Émilie Feral
b485319e76
[python] Clean gc_collect and comment to explain potential address
...
sanitize error
2019-06-14 13:37:11 -04:00
Émilie Feral
c0da810ea1
[python] Turtle module: fix modturtle_gc_collect from stack-buffer-overflow
2019-06-14 13:37:11 -04:00
Émilie Feral
927b69067c
Merge branch 'version-11' into f7
2019-05-03 17:25:53 +02:00
Léa Saviot
3a390111d8
[python/urandom] Use Ion::random to seed urandom
2019-05-03 15:54:20 +02:00
Léa Saviot
352850e481
[python] Fix typo
2019-05-03 15:54:20 +02:00
Léa Saviot
e8b3db76b2
[python/turtle] Fix rounding errors
...
Some horizontal/vertical lines were not properly drawn
Example script:
from math import *
from turtle import *
def a():
def carre(n):
fd(n)
right(90)
fd(n)
right(90)
fd(n)
right(90)
fd(n)
right(90)
penup()
goto(-158,109)
pendown()
carre(100)
for j in range(10):
for i in range(26):
penup()
fd(2)
pendown()
carre(10)
penup()
fd(10)
pendown()
penup()
goto(-158,109-10*(j+1))
pendown()
2019-05-03 15:53:21 +02:00
Émilie Feral
9e962874b6
Merge branch 'version-11' into HEAD
2019-04-29 18:00:17 +02:00
Romain Goyet
42f72eee77
[python/kandinsky] draw_string takes two optional colors (text/bg)
2019-04-26 17:44:27 +02:00
Romain Goyet
ec50e75a3a
[python/kandinsky] Bubble-up input errors before switching to draw mode
2019-04-26 17:44:27 +02:00
Romain Goyet
926b96cafb
[python/kandinsky] Expose the fill_rect method
...
Which allows for *much* faster graphics
2019-04-26 17:44:27 +02:00
Romain Goyet
bb89ae9211
[python/kandinsky] Color can now be passed as a tuple
...
The values are expected to be integers between 0 and 255
2019-04-26 17:44:27 +02:00
Léa Saviot
03bb81215e
[python/urandom] Use Ion::random to seed urandom
2019-04-17 11:46:01 +02:00
Léa Saviot
f9e2fc6974
[python] Fix typo
2019-04-17 11:46:00 +02:00
Émilie Feral
694fa34315
[ion] Keyboard: change keys name to more explicit ones
2019-04-12 16:56:57 +02:00
Léa Saviot
246349e72f
[python/turtle] Fix rounding errors
...
Some horizontal/vertical lines were not properly drawn
Example script:
from math import *
from turtle import *
def a():
def carre(n):
fd(n)
right(90)
fd(n)
right(90)
fd(n)
right(90)
fd(n)
right(90)
penup()
goto(-158,109)
pendown()
carre(100)
for j in range(10):
for i in range(26):
penup()
fd(2)
pendown()
carre(10)
penup()
fd(10)
pendown()
penup()
goto(-158,109-10*(j+1))
pendown()
2019-04-12 15:16:53 +02:00
Léa Saviot
2a34f955ca
[python/turtle] Fix some turtle jumps
...
There was a drawing glitch for instance when doing goto(100,100).
It was due to the tutle mileage being overflowed.
2019-03-12 09:51:40 +01:00
Léa Saviot
ddb22ba1a2
[python/turtle] Fix drawing of diagonal lines
2019-03-12 09:51:40 +01:00
Léa Saviot
147c1b4592
[python/turtle] Make the turtle faster on emscripten
...
It was slower than on the calculator
2019-03-12 09:51:40 +01:00
Léa Saviot
a036bff275
[python/turtle] Fix setHeadingPrivate (handle big angle errors)
2019-02-11 13:41:10 +01:00
Léa Saviot
3faee8bcd8
[python/turtle] Special case when goTo draws horizontal/vertical line
2019-02-06 11:45:03 +01:00
Léa Saviot
b5e278526f
[python/turtle] Use namespace std
2019-02-06 11:45:03 +01:00
Léa Saviot
287dedabc0
[python/turtle] The turtle heading is in [0;360[
2019-02-06 11:45:03 +01:00
Léa Saviot
a25b2a8ce5
[python/turtle] Fix unwanted dotted lines
...
Script:
fd(200)
left(90)
fd(10)
left(90)
fd(600)
The final line should be continuous but is dotted
2019-02-06 11:45:03 +01:00
Léa Saviot
a021af46fe
[apps/code] Hide the sandbox between script importations
2019-02-06 11:45:03 +01:00
Léa Saviot
fdc02ee5e1
[python/port] Fix size of gc collection
2019-01-21 14:23:38 +01:00
Léa Saviot
835c112f2f
[python/port] Clean gc_collect
2019-01-21 14:23:38 +01:00
Léa Saviot
5e714c371c
[python/turtle] Increase chances that GC collection works fine on turtle
2019-01-21 14:23:38 +01:00
Léa Saviot
2bde26af69
[python/turtle] Specify namespace std when using cos, sin
2019-01-21 13:39:47 +01:00
Léa Saviot
2f9f40f1a7
[python/turtle] Store the heading in degrees with no k_headingOffset
...
This reduces rouding errors, such as:
setHeading(0)
right(1)
heading() -> gives -1.00...01
2019-01-21 13:39:47 +01:00
Léa Saviot
177373c5af
[apps/code] Handle carriage returns in the input text
2019-01-10 11:42:05 +01:00
Léa Saviot
c2dbe9f7cc
[python/turtle] Fix line drawing glitches
2018-12-21 11:57:36 +01:00
Léa Saviot
5a941bc1d5
[python/turtle] Clean circle code
2018-12-21 11:57:09 +01:00
Léa Saviot
4b306791c0
[python/turtle] Turtle::m_drawn is false if sandbox not displayed
...
This way, Turtle::draw() and erase() are more symetrical and no not
perform themselves if the turtle is already drawn / erased.
2018-12-18 12:05:46 +01:00