Python micropython.alloc_emergency_exception_buf() Examples
The following are 6
code examples of micropython.alloc_emergency_exception_buf().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
micropython
, or try the search function
.
Example #1
Source File: Kernel.py From illuminOS with MIT License | 5 votes |
def __init__(self, os_properties): # Read OS properties self.os_properties = os_properties micropython.alloc_emergency_exception_buf(100) # Logger self.logger = Logger(self.os_properties['log_level'])
Example #2
Source File: boot-cdc.py From upy-examples with MIT License | 5 votes |
def init(): if True: uart = pyb.UART(6,115200) pyb.repl_uart(uart) print("REPL is also on UART 6 (Y1=Tx Y2=Rx)") if True: bufsize = 100 print("Setting alloc_emergency_exception_buf to", bufsize) micropython.alloc_emergency_exception_buf(bufsize)
Example #3
Source File: Tach.py From upy-examples with MIT License | 5 votes |
def test(): """Test program - assumes X2 is jumpered to X1.""" micropython.alloc_emergency_exception_buf(100) print("Starting tach") tach = Tachometer(timer_num=2, channel_num=1, pin_name='X1') print("Starting pulses") t5 = pyb.Timer(5, freq=4) oc_pin = pyb.Pin.board.X2 oc = t5.channel(2, pyb.Timer.OC_TOGGLE, pin=oc_pin) for freq in range(0, 600, 100): if freq == 0: freq = 1 else: t5.freq(freq * 4) # x 2 for toggle, x2 for 2 pulses_per_rev pyb.delay(1000) print("RPM =", tach.rpm(), "Freq =", freq, " as RPM =", freq * 60) # stop the pulses print("Stopping pulses") oc_pin.init(pyb.Pin.OUT_PP) # wait for 1.5 seconds pyb.delay(1500) print("RPM =", tach.rpm()) print("RPM =", tach.rpm()) print("Starting pulses again") # start the pulses up again oc = t5.channel(2, pyb.Timer.OC_TOGGLE, pin=oc_pin) pyb.delay(2000) print("RPM =", tach.rpm()) print("RPM =", tach.rpm())
Example #4
Source File: boot-msc.py From upy-examples with MIT License | 5 votes |
def init(): if True: uart = pyb.UART(6,115200) pyb.repl_uart(uart) print("REPL is also on UART 6 (Y1=Tx Y2=Rx)") if True: bufsize = 100 print("Setting alloc_emergency_exception_buf to", bufsize) micropython.alloc_emergency_exception_buf(bufsize)
Example #5
Source File: boot-hid.py From upy-examples with MIT License | 5 votes |
def init(): if True: uart = pyb.UART(6,115200) pyb.repl_uart(uart) print("REPL is also on UART 6 (Y1=Tx Y2=Rx)") if True: bufsize = 100 print("Setting alloc_emergency_exception_buf to", bufsize) micropython.alloc_emergency_exception_buf(bufsize)
Example #6
Source File: boot-cdc-only.py From upy-examples with MIT License | 5 votes |
def init(): if False: uart = pyb.UART(6,115200) pyb.repl_uart(uart) print("REPL is also on UART 6 (Y1=Tx Y2=Rx)") if False: bufsize = 100 print("Setting alloc_emergency_exception_buf to", bufsize) micropython.alloc_emergency_exception_buf(bufsize)