8000 alloc_emergency_exception_buf on esp8266 do not exist · Issue #2431 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content
8000

alloc_emergency_exception_buf on esp8266 do not exist #2431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
muhlpachr opened this issue Sep 17, 2016 · 10 comments
Closed

alloc_emergency_exception_buf on esp8266 do not exist #2431

muhlpachr opened this issue Sep 17, 2016 · 10 comments

Comments

@muhlpachr
Copy link
>>> import micropython
>>> micropython.alloc_emergency_exception_buf(100)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'alloc_emergency_exception_buf'
>>> dir(micropython)
['__name__', 'mem_info', 'qstr_info', 'stack_use', 'heap_lock', 'heap_unlock']
@dpgeorge
Copy link
Member

I guess it can be added, it's a useful function to have.

Would be nice to have a shorter name though, alloc_emg_exc_buf anyone?

@deshipu
Copy link
Contributor
deshipu commented Sep 23, 2016

How about just exc_buffer? It's implied that we are setting its size, and 'emergency' doesn't add much information.

@hosaka
Copy link
Contributor
hosaka commented Sep 27, 2016

I would agree that "emergency" is not as helpful, but would vote for expanding the "exc" to exception_buf or exception_buffer. I'm happy to submit a patch for this.

@dpgeorge
Copy link
Member

It needs the word "emergency" because otherwise you'd think it was allocating a general buffer for use by all exceptions.

@deshipu
Copy link
Contributor
deshipu commented Sep 28, 2016

Normally I would agree that spelling out "exception" is a good idea, however, with the limited memory and with "exc" being used to mean "exception" in Python's standard library already (like here https://docs.python.org/2/library/traceback.html#traceback.print_exc), this is not so painful.

How about using a more meaningful word than "emergency" to indicate when that buffer is used? Perhaps callback_exc_buf or interrupt_exc_buf?

@dpgeorge
Copy link
Member

How about using a more meaningful word than "emergency" to indicate when that buffer is used?

What about alloc_fallback_exc_buf, or even alloc_fallback_exc?

@deshipu
Copy link
Contributor
deshipu commented Sep 28, 2016

I think that fallback hits the meaning well, not sure if we need alloc or any other verb there, but I'm not a native speaker.

@pfalcon
Copy link
Contributor
pfalcon commented Sep 28, 2016

Given that I have (and going to have) bunch of proposals of what to change in uPy API(s), I'd compensate that by being conservative with changing something which could be not changed (IMHO of course), like this case, and give my -0.01 on it.

However, I'd say that if there's pressure to cut whole words out, then "exception buffer" already gives enough hints that it's a special helper for exceptions (we don't buffer exception normally, so if we talk about exception buffer, that's already something for exceptional conditions, d'oh). That naturally contracts to exc_buf. And if there's future desire to cut chars from alloc_exc_buf(), can be made set_exc_buf().

@pfalcon
Copy link
Contributor
pfalcon commented Oct 11, 2016

If there's no consensus on renaming the function, I guess it still should be enabled for 1.8.5.

@dpgeorge
Copy link
Member

Ok, let's defer discussion about changing the name.

Enabled in ed87827.

tannewt pushed a commit to tannewt/circuitpython that referenced this issue Dec 28, 2019
define board.VOLTAGE_MONITOR for feather_stm32f405_express
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0