You might wonder how this fixes a problem with PulseIn, when the
changes aren't to any of those files! PulseIn is implemented in terms of
StateMachine, which had some assumptions about the relation between
the index of a pin object in mcu_pin_global_dict_table and its "pin
number". This was true, until some pins were removed from the
microcontroller module on Pico W.
Closes: #7078
Weirdly we have to stop the AP too (which we never started),
or cyw43_tcpip_link_status still reports that STA is connected.
As long as AP mode isn't implemented, this doesn't matter and
we can just do it.
Foamyguy discovered that trying to send >2920 bytes at once consistently
failed. I further discovered that sometimes trying to send >1460 bytes
would fail too. By "fail", I mean that it would take a very long time
(around 200 * 50ms) before erroneously reporting that all bytes were
written.
In my testing, this change causes larger writes to successfully
send either 2920 or 1460 bytes (possibly after doing some 50ms waits
for a previous packet to clear).
The documentation of socket.send always stated that it COULD send fewer
bytes than requested, but adafruit_httpserver assumed that the number
of requested bytes were always sent, so after this change alone,
adafruit_httpserver will still not work properly.
Closes: #7077 (albeit fixes are needed in adafruit_httpserver too)
This reduces power consumption during true deep sleep.
In my measurements with ppk2 and a program that _irrevocably_ entered
deep sleep (no time alarm or pin alarm), power usage as measured on a
ppk2 decreased from ~10mA to ~1mA.
Another reduction of -48 bytes can be had if the fine calculation
step is skipped. The worst difference compared to the old reference
code with my calibration values in the 0° to 60° was 2°C,
and the difference at 25°C is 1°C.
The final size decrease for non-full builds like Trinket M0 is 268
bytes.
Perform most arithmetic with scaled integer values.
For my calibration values
```
const uint32_t NVMCTRL_TEMP_LOG[]={0xfc05511e, 0xcc7ac0f7};
```
the maximum difference between the old and new calculation is 0.50°C.
The difference is smallest (0.13°) at 25.87°C in the old scale.
This reduces mcu_processor_get_temperature from 568 bytes to 348 bytes
(-220 bytes)
The prefixed versions raise Python exceptions, the un-prefixed return
negative error values. We don't want to raise an exception from here,
it leaves the SSL stack in an undefined state.