#circuitpython-dev

1 messages ยท Page 256 of 1

tidal kiln
#

yep. both.

meager fog
#

yeah we set to 16bit but return 8bit

tidal kiln
#

two places

meager fog
#

guh

#

ez fix at least ๐Ÿ˜ƒ

tidal kiln
#

yep. super.

#

easy.

#

ill pr

meager fog
#

thank u

#

on 'release' can you attach firmware uf2's n bins

#

theres no formal release method

tidal kiln
#

i can look into that

#

are those just generated by hand?

meager fog
#

yep

tidal kiln
meager fog
#

@tidal kiln yeah cause its plain avr-gcc

ruby atlas
#

@slender iron I was wondering, as I work to reduce _pixelbuf footprint, should I have one single QSTR for invalid byteorder strings?

slender iron
#

one error message @ruby atlas?

#

sure

#

@exotic pumice c interop with all of our existing code

ruby atlas
#

Yeah, that was my idea @slender iron .

#

I also seem to need to tighten up pypixelbuf and probably should make sure I have board(s) that _pixelbuf doesn't fit to test with.

slender iron
#

๐Ÿ‘

tidal kiln
#

@meager fog do you know if there is any differences between boards/crickit and boards/crickitHat (in seesaw)

ruby atlas
#

Also I totally must have an off-by-one and/or failure to properly (re)initialize data in my latest push of _pixelbuf because it misbehaves badly with dotstars ๐Ÿ˜ƒ

meager fog
#

@tidal kiln yes

#

the hat has UART-serial converter

tidal kiln
#

so need a UF2 for each? there was only one there previously

meager fog
#

there should be two yeah

#

i think dean didn't think to add both

#

:/

#

but if you could, that would be great for the pi users ๐Ÿ˜ƒ

tidal kiln
#

ok. no worries. i'll build and add.

meager fog
#

thanks, can u reply to the thread, as well

#

they should be able to update the uf2 and be golden

tidal kiln
#

yep. already done.

meager fog
#

huzzah for uf2

#

uf2 is so much better than "ok now install bossac"

#

๐Ÿ‘Ž

tidal kiln
#

yep. i tested on HAT and feather crickit.

meager fog
#

you rock

manic glacierBOT
ruby lake
#

@meager fog finally have the adabox!

meager fog
#

@ruby lake yayyyy

ruby lake
#

thanks again. I'm switching shipping addr to the loading dock at work to prevent this from happening again

meager fog
#

lol ok

manic glacierBOT
#

4.0.2 stable is enough ... I'll try to replicate the problem on the weekend.
Have you been able to re-flash the board since?

I'm not sitting in front of the hardware right now, but there's a read-only connected property on the interface itself, eg:

eth = wiznet.WIZNET5K(spi, board.D10)
while not eth.connected:
    print("plug me in!")
    time.sleep(1)

You still have to poll it though. Also, connected just tells you if there's a cable to a switch port: you still have t...

exotic pumice
#

yeah you might have to generate a bunch of bindings to all your special types idk

manic glacierBOT
onyx hinge
#

@exotic pumice another potential concern is that circuitpython uses deep magic to do "something like exceptions" through gcc extensions to the C language. Not sure what would be needed to apply that to rust.

pastel panther
#

@tulip sleet Are there any particular areas that the BLE code needs testing? I'm doing some lighting stuff any plan to use '840s

tulip sleet
#

@pastel panther in a few days, but I'm having to do BLE descriptors more completely in order to do BLE HID, so not yet. You could try stress testing the current examples to see if they crash or get stuck in pathogical cases. But what do you mean by lighting?

pastel panther
#

I'm wiring up a display case and my office with neopixels and want to build a board to control and power them

tulip sleet
#

you could take the lanyard project as a base and take off from there, controlled by the Bluefruit app. Or you could use the peripheral/client example that's in the tip of Adafruit_CircuitPython_BLE and use '840's for both client and server

#

you can use the Adafruit_CircuitPython_BluefruitConnect and use the packet types, or just use raw BLE UART and invent your own protocol

manic glacierBOT
lime trellis
manic glacierBOT
manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
#

You still have to poll it though. Also, connected just tells you if there's a cable to a switch port:

Ok, great! EthernetManager would take care of that.

When you set up this weekend, could you try checking to see if ifconfig succeeded, without plugging in the ethernet cable? It should cause a hardfault.

Have you been able to re-flash the board since?

Yup - had to run SPIFlash on it first. Adding a UF2 to FEATHERBOOT couldn't recover it.

Arguably, given CircuitPython's...

prime flower
#

@lime trellis Sweet, doubly so on "conforming" to the RFM9x notation to keep semtech libs in-line ๐Ÿ˜ƒ

upbeat plover
#

@lime trellis the time-of-flight ranging can that be used for triangulation? i was thinking for like robots in like a warehouse environment

lime trellis
#

@upbeat plover Yeah it can!!! there's very little documentation online . The Semtech app note states 0.42m precision

#

@prime flower it'll be somewhat tough given how different the RF9x chips are
designed to interface as opposed to the SX1280. But I should be able to get it pretty close

manic glacierBOT
#

I have been trying to avoid this because I don't have much background in it. :smiley: .
If there are really zero I2C chips that need separate stop control with write-then-read, then it's ok with me in the long run. If not, then leaving it in isn't wrong.

@deshipu, if you can do the attribute check as suggested by @tannewt, then that might be good enough.

If busdevice is too slow, we should consider how to speed it up (make it native?). In the code link above, we could at least check ...

manic glacierBOT
#

All of the related logic is stored in PWMOut: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/pulseio/PWMOut.c#L154

There is no central list of active PWMOuts so you'll need to track it if you plan on dynamically swapping them.

Adding support for TC[0] isn'd likely what you want because it'll drastically reduce the functionality of the PWMOut to 8 bit resolution or very course frequency (since the top can't change much).

manic glacierBOT
#

In Trio, we teach beginners that await blah() is a special kind of function call, that you use when calling special functions defined with async def. We don't teach about await obj syntax, bare coroutine objects, the awaitable protocol, or any of that. This means we can't use some clever tricks like async_property, but I think the simplification is worth it. (It also makes it pretty easy for linters to detect when you forgot an await, which is otherwise a really easy and confusing...

#

I was thinking if scale is 1, one pixel on the display represents one pixel in the buffer. If scale is 2, 2x2 pixels on the display represent one pixel in the buffer. It depends on which pixels you mean. We are making different assumptions. I wasn't sure what scaling the "display" meant, but it means scaling the buffer onto the physical display. If you can think of a clearer way to say this, fine, but no real problem if you just leave it this way.

The only other thing is that the word ...

manic glacierBOT
#

That's pretty much why I didn't write it โ€” I can't think of a concise and non-confusing way of putting it. For example "with scale=2 every logical pixel corresponds to four physical pixels" creates more questions than it answers: why four? what is a logical pixel?

I reworded it and fixed the missing argument name, but I think I don't want to spend too much time on this, as this is an internal interface, used only by the Python library that wraps it. I will make sure to explain that functio...

manic glacierBOT
manic glacierBOT
onyx hinge
#

the good news is, for some reason -flto seems to work on nrf builds now. the bad news is, it looks like it pushes us over a travis 50-minute limit, so it would mean repartitioning things. Persumably into 10 ~25 minute jobs instead of 5 ~45 minute jobs. I'm still running a few local tests to make sure all the binaries look plausible; I only really tested on a particle xenon

#

the other bad news is, I don't have any explanation for why it would work when I tried it today, after not working in the pats. That would have been with the older, lesser (52832?) boards, or maybe an older nRF SDK?

onyx hinge
#

.. all the .uf2 files for nrf2 boards seem to have plausible sizes ..

slender iron
#

@onyx hinge what is the reason to turn lto on? we ideally wouldn't split into 10 jobs because then the 10 concurrent we already have would be used up

#

with one build

onyx hinge
#

@slender iron It frees up flash and I think it has a large effect on the efficiency of translate()

slender iron
#

ah, ya. translate is designed to use lto

#

shouldn't be used that often though

onyx hinge
#

On particle_xenon it gains back 60kB of flash (but that device is far from flash-constrained) but adds 12s to the elapsed build time on my local machine

slender iron
#

12s isn't that bad but I think that hits each language build

onyx hinge
#

a different structure for "non-lto" targets would let translate be more efficient, such as a structure which can be binary-searched. But as you say, the speed of translate() might not be important to any "real benchmark".

#

(or we could be mistaken, with translate() called more than we thought)

slender iron
#

yup, I'm ok having lto on for everything for consistency but our build time is a pain

onyx hinge
#

If going to >5 jobs in the matrix means you lose the -j2 parallelism in each one .. ugh

#

am I not finding it, or is this not clearly documented at travis?

slender iron
#

the 10 jobs is the tier that adafruit pays for

#

its 5 for open source by default

stuck elbow
#

I wonder at which point it would make sense to run your own server for CI

#

sure, lots of work for setting it up, and then some constant work to maintain it

manic glacierBOT
onyx hinge
#

hum, I have set up so travis-ci.org runs when I push to jepler/circuitpython and I would have sworn the timings were not much different from what travis-ci.com gets for adafruit/circuitpython

slender iron
#

@stuck elbow I think we'd switch services and/or pay for more grunt before we run our own

#

I started testing with azure but ran into difficulty uploading to s3

stuck elbow
#

they would probably want you to use their own storage

onyx hinge
#

so my build did time out, while adafruit's completed with some of the jobs going >50 minutes

slender iron
#

@stuck elbow I'm ok using theirs too but lost steaming figuring it out

stuck elbow
#

yeah, this can get complex really fast

onyx hinge
#

but maybe that also means I should just turn off travis-ci.org for my fork and rely on travis-ci.com and pull requests. that'd be the only way to see the real effect on build times by this lto change.

raven canopy
#

i still want to understand why the pl build takes longer than the rest. i haven't been able to put my finger on it...

onyx hinge
#

I'm looking at this code in WaveFile.c: ``` self->buffer = m_malloc(self->len, false);
if (self->buffer == NULL) {
common_hal_audioio_wavefile_deinit(self);
mp_raise_msg(&mp_type_MemoryError, translate("Couldn't allocate first buffer"));
}

self->second_buffer = m_malloc(self->len, false);
if (self->second_buffer == NULL) {
    common_hal_audioio_wavefile_deinit(self);
    mp_raise_msg(&mp_type_MemoryError, translate("Couldn't allocate second buffer"));
}

Is memory allocated by m_malloc required to be m_free'd?  And if so, should `buffer` be m_free'd in the second error handling block, or is it take care of elsewhere?
stuck elbow
#

no, it's garbage-collected

onyx hinge
#

OK

stuck elbow
#

but I do want to change that code to let you specify a pre-allocated buffer

onyx hinge
#

fwiw is there a m_malloc variant which will do the check-and-raise for me?

stuck elbow
#

I think they all raise MemoryError when you run out

onyx hinge
#

I think that's true, in which case the 'if (self->buffer == NULL)' block is dead code

#

hm is 'if (' the circuitpython style? I know I have been writing 'if(' everywhere. oops.

meager fog
stuck elbow
#

yeah, it gets it from Python, there is always a space separating keywords

simple pulsar
#

@onyx hinge do you mean = or == ?

onyx hinge
#

@simple pulsar oops, "==" -- will edit

simple pulsar
#

Oh, i scrolled up further and saw actual code too.

onyx hinge
#

yeah that big block is right, it was copypaste

lime trellis
#

@meager fog very cool! I hadn't seen those. I'll pick a few up to play with. Well at least my layout files are out there in case someone wants to tinker ๐Ÿ˜ƒ

onyx hinge
#

seems like if the _deinit call is needed, then it needs to be m_malloc_maybe

meager fog
#

@lime trellis yeah these are not pin compat for some reason ๐Ÿ˜›

onyx hinge
#

is this worth filing an issue over? @stuck elbow

lime trellis
#

@meager fog drop-in compatible with RFM9x modules was a biggie for me.

onyx hinge
#

time to wrap this up, date night technically started at 6PM (11 minutes ago ๐Ÿ˜ƒ )

stuck elbow
#

@onyx hinge I'm actually not 100% sure that is a case, I would need to test it...

onyx hinge
#

@stuck elbow I'll leave it in your hands if you're inclined to look into it further

stuck elbow
#

I might give it a stab this weekend, if the stars are right

manic glacierBOT
#

Ok, so I think I know what I want to replace wait_for_frame and refresh_soon with. I think we want an explicit refresh call that blocks until new pixels have been sent to the display (but not wait on epaper refresh.)

For fast screens it'll have a target_fps kwarg that takes a target frame rate and skips the pixel update if the time since the last frame is more than the gap needed for the frame rate. It'll also have an max_delay that will cause an exception if the time since the l...

#
[adafruit/circuitpython] New tag created: 4\.1\.0
tough flax
#

Hey folks, did the PIRKey die?

manic glacierBOT
tough flax
meager fog
#

yes right now its dead. there's no ETA

tough flax
#

Ok, @brisk cairn was looking at designing one & I suggested he take a look at yours...

meager fog
#

yes you can grab the design for sure

#

i will try it soon to see if 4.1 has made it more usable

tough flax
#

If you want to send Chris & I a few to test, we can

manic glacierBOT
meager fog
#

@tough flax ๐Ÿ‘

orchid basinBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

@meager fog Ready to start the circuitpython port to risc-v!

manic glacierBOT
tough flax
raven canopy
#

MixerVoice builds again! now to test it... ๐Ÿ˜ฌ

#

test script is still on the board! how lucky is that?

#

just had to tweak the script for audiocore and huzzah!

Adafruit CircuitPython 4.0.0-alpha.2-1587-g9939d0c4f-dirty on 2019-08-02; Adafruit Metro M4 Express with samd51j19
>>> import mixervoice
Reading file monday1.wav
{'data_size': 187820, 'channels': 2, 'sample_rate': 16000, 'num_samples': 93910}
done!!
playing intro...
starting voices endless-loop...
playing: 2. gain: 0.883587
playing: 3. gain: 0.961244
playing: 2. gain: 0.396811
playing: 3. gain: 0.16575
playing: 2. gain: 0.546836
slender iron
#

@raven canopy w00t! thank you so much for polishing it up

raven canopy
#

no worries. PR in the morning...

#

still needs some doc updates.

slender iron
#

๐Ÿ‘

stuck elbow
#
$ git submodule update --init --recursive
Submodule path 'lib/tinyusb': checked out '1ee9ef4f2b7c6acfab6c398a4f57ca22036958f7'
Submodule path 'lib/tinyusb/hw/mcu/microchip/samd/asf4': checked out '82fe3aa05bc3b9f4956ee775c748a3885443f66b'
Submodule path 'lib/tinyusb/hw/mcu/nordic/nrfx': checked out '9d68726e41c321f1772c187bd12d82f5b13104f1'
Submodule path 'lib/tinyusb/hw/mcu/nxp/lpcopen': checked out '06b4c2e509147924b66ace90f6be5ebe599af45c'
error: Server does not allow request for unadvertised object 1dabc2df8ed1acaf0c483b58d757ba72e8b42090
Fetched in submodule path 'lib/tinyusb/hw/mcu/st/stm32lib', but it did not contain 1dabc2df8ed1acaf0c483b58d757ba72e8b42090. Direct fetching of that commit failed.
Failed to recurse into submodule path 'lib/tinyusb'
#

someone forgot to push?

manic glacierBOT
manic glacierBOT
#

Good idea! A few thoughts pre-review:

  • The doc should probably say that if a buffer is not passed in, a buffer of 512 bytes (or say that two buffers of 256 bytes) will be used. This will give the user guidance about how big to make the buffer.
  • Should one buffer that's split be passed, or two? If two, the smaller of the two will determine the length used. (Or they could be required to be of equal length). The advantage of two buffers is that they might be easier to allocate in the face ...
#

Good point about documenting the default size, I will add that.

I went for a single buffer mostly because it simplifies the usage, and lets us skip explaining what double buffering is. I'm not worried about memory fragmentation, because it's going to be allocated at the beginning of your program anyways.

By the way, experiments show that a much smaller buffer than 512 seems to be working just fine, so we might want to reconsider the default.

manic glacierBOT
onyx hinge
#

I โค waking up in the morning and having the answer to a puzzle be clear.

manic glacierBOT
#

Thanks @tannewt . I'm having a play with it now. I think it could be doable within the same logic already there but would take a bit of time.

I discovered one issue already with the errors that are sent back when no timers are free.

If you look at my first output in this comment: https://github.com/adafruit/circuitpython/issues/2020#issuecomment-516826913

It says "All timers in use" instead of "All timers for this pin are in use"

I am not sure if this is expected behaviour ...

#

I'm thinking about submitting a similar pull request as #2032, but for bitmaps. One thing I would like to add there, though, is the possibility of using a bytes object as the buffer (possibly one that is frozen with your library in flash) โ€” but then the bitmap would need to be read-only, as we can't modify the contents of such a buffer. I think the easiest way to do that would just be to have an internal flag in the Bitmap object that is set when such a buffer is passed to it, and makes i...

manic glacierBOT
manic glacierBOT
manic glacierBOT
ruby atlas
#

@onyx hinge I like the pull request number you got there (#2000).

onyx hinge
#

@ruby atlas I think it was my lucky day

#

I bet the next 2000 go faster

ruby atlas
#

I'm hoping I can get #2345 or maybe #4321 ๐Ÿ˜ƒ

raven canopy
#

:ohnoes: MixerVoice has incomplete code for non-__ARM_FEATURE_DSP chips. how in the world will i channel DeanM? #stuffjustgotreal

onyx hinge
#

@raven canopy which chips are those?

raven canopy
#

according to my travis failures...i'm not sure. I have passes and fails, for both M0 and M4. it may just be a define/linker issue? about to run out for lunch and school shopping. will have to dive in later

#

hmm. the M4 failures are pointing to "can't find linker file <blah>.ld"

onyx hinge
#

@raven canopy that seems .. unexplained

swift arrow
#

@slender iron: I'm still trying to fix the SD card issue.. like #13 . Question, what is considered "power On" of the sdcard?

raven canopy
#

that one actually seems easy. probably part of the merge when bringing the stale branch up to date.

swift arrow
#

Connect to the card and mount the filesystem.

spi = busio.SPI(board.SD_SCK, board.SD_MOSI, board.SD_MISO)
cs = digitalio.DigitalInOut(board.SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)

#

The reason I ask is say I wanted to power-cycle the card and start the init process over. How would one "cycle power" to the card in CP?

onyx hinge
swift arrow
#

@onyx hinge I think the error is card related on all boards. The board I am using is the Grand Central.. but the issue #13 I believe is more against the cards

#

ie some cards work.. but one that doesn't is the Samsung EVO 32 GB

onyx hinge
#

and while trying to debug it, you wish you could cut the power so you knew for sure it was reset..?

swift arrow
#

kind of.. I wanted to add a routine to @slender iron's lib.. basically where he calls OS error on init.. I wanted to try a power-cycle the card and try a different init sequence.

#

I think CMD0 for SDcards will be close enough to a power cycle.

onyx hinge
#

CMD0 is worth a try, I don't think physically resetting or disconnecting the supply voltage is possible without modifications to the schematic

swift arrow
#

@onyx hinge I appreciate you looking at the diag.

onyx hinge
#

happy to

swift arrow
#

I'm pretty certain the issue is in the init sequence.. so I will keep trying things. Unfortunately different cards need slightly different timings and strings sent to them. My first bug.. and I pick something crazy complex. ๐Ÿ˜ƒ I never realized that hardware made to a standard.. could vary so greatly. Probably common knowledge to veterans.

manic glacierBOT
manic glacierBOT
#

Hi all,

I'm trying to add a custom module that generates Bitcoin addresses to a CircuitPython build. I am building off of the 4.1.x branch.

However, I'm overflowing the available FLASH space by about 44KB

/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: build-circuitplayground_express/firmware.elf section `.text' will not fit in region `FLASH'
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 44412 bytes
collect2: error...
stuck elbow
#

@slender iron any starting point you would recommend for a non-express samd51 board? I think you mentioned that your gameboy cartridge uses that? I can't find it in the board definitions.

manic glacierBOT
#

Thanks for the responses all!!

@dhalbert thank you, I'll look there.

@ladyada I've been interested in trying the Grand Central so I'd like to get an M4 build working. But when I tried to compile for that, I got an error I can't quite figure out:

``
`/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: build-grandcentral_m4_express/firmware.elf uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/libc_nano.a(lib_a-explicit_bzero.o...

stuck elbow
#

I think I have it working

river quest
pastel panther
#

@stuck elbow if you're willing to use Eagle,I can shower you in boards

manic glacierBOT
#

The scanning works! Here's my code:

import bleio
scanner = bleio.Scanner()
entries = scanner.scan(1)

I have a couple of requests.

  1. Scan returns a lot of duplicate entries. Would it be possible to only return unique entries? Would this also speed up the scanning?
  2. Address.address_bytes returns the address reversed. Can it please be swapped? On a side note, it looks like CircuitPython doesn't support reversing strings using [::-1]. It throws NotImplementedError only s...
manic glacierBOT
#

Hi Dan and Limor, I updated my compiler to the one you've recommended.

After some minor adjustments to code on my end, I was able to compile for the Grand Central (M4) board. Looking forward to testing the build when I get that product ordered.

I'll also play around and see if I can get my build it to fit on an M0 board like the Circuit Playground with those tips on removing default modules.

Thanks for all of your help, that resolves the questions I have!

swift arrow
manic glacierBOT
#

Check out the alpha release of https://github.com/adafruit/Adafruit_CircuitPython_BLE/releases/tag/2.0.0-alpha.0. adafruit_ble.Scanner has support for suppressing duplicates and other features. The bleio functionality is designed to be the minimum necessary, and we're layering Python code on top for end-user use in many cases.

The address bytes are as fetched from the advertisement. It will print in the correct direction, I think. I am trying to imitate the direction used by various BL...

#
  • Can't replicate on ~4.0.0 e00a702ce (which is what was still on my board) ... Ctrl-C breaks out of the loop as expected.
  • Ditto a fresh build of 4.0.2 ... I can run your code above w/ no cable attached & it breaks out fine. DHCP discovery is running happily in the background.
  • eth.connect works as expected ... it depends on the physical interface, not the network actually being useful.
  • when DHCP succeeds, the loops exits as expected and example.com is coming through fine.

In shor...

inland tusk
#

@tough flax @slender iron @meager fog I have a RV32M1-VEGA board that I would lend to someone who would be willing to try a CP port. Should be able to find the specs on open-isa.org.

slender iron
#

@idle owl are you around for monday's meeting? I can't remember if so

idle owl
#

@slender iron I am not.

slender iron
#

kk, will send out the notes doc now. thanks @idle owl

idle owl
#

Thank you!

slender iron
#

np ๐Ÿ˜ƒ

#

The CircuitPython weekly meeting is here on Discord on Monday at 11am Pacific / 2pm Eastern. All are welcome to join in. The notes doc with more details is here: https://docs.google.com/document/d/123Dv62ODdD-Qt2XteHLP8NQZJPqVKAAH__kZkq4fpaU/edit?usp=sharing <@&356864093652516868>

stuck elbow
#

@pastel panther I was thinking about board definition in CP

manic glacierBOT
#

Pull request #2032 suggests to add a pre-allocated buffer to WaveFile. However, maybe there's a different route that would be better. Let's see if we can flesh it out.

It appears that in general, while actually DMA'ing the audio data to the DAC, PWM, or I2C destination, there's an unavoidable need for a chunk of audio data in an arrangement that suits the specific hardware implementation. For example, on nrf's PWMAudioOut, it is a number of 32-bit blocks, which may contain 1 or 2 channe...

manic glacierBOT
raven canopy
#

meanwhile, sommersoft is over here struggling to wrap his head around inlining multiplication with bit-shifting, signs, and casting. #stay-in-school-kids!

stuck elbow
#

just let the computer figure it out?

raven canopy
#

i may be overthinking, while definitely overwhelmed, writing an "equally fast" non-DSP-capable version for each of these:

static inline uint32_t mult16signed(uint32_t val, int32_t mul) {
    #if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1))
    int32_t hi, lo;
    int32_t bits = 16; // saturate to 16 bits
    int32_t shift = 0; // shift is done automatically
    asm volatile("smulwb %0, %1, %2" : "=r" (lo) : "r" (mul), "r" (val));
    asm volatile("smulwt %0, %1, %2" : "=r" (hi) : "r" (mul), "r" (val));
    asm volatile("ssat %0, %1, %2, asr %3" : "=r" (lo) : "I" (bits), "r" (lo), "I" (shift));
    asm volatile("ssat %0, %1, %2, asr %3" : "=r" (hi) : "I" (bits), "r" (hi), "I" (shift));
    asm volatile("pkhbt %0, %1, %2, lsl #16" : "=r" (val) : "r" (lo), "r" (hi)); // pack
    return val;
    #else
    uint32_t result = 0;
    //TODO:
    for (int8_t i = 0; i < 2; i++) {
        int16_t ai = val >> (sizeof(int16_t) * 8 * i);
    }
    return result;
    #endif
}
stuck elbow
#

's eyes glaze over as he sees assembly

raven canopy
#

mind you, that is exactly where DeanM left it. it appears that M0+ has a "fast multiply" (1 cycle) thumb instruction, i just can't figure if we have it enabled or not.

#

and...exactly. ๐Ÿ˜„

stuck elbow
#

you can't just test it?

raven canopy
#

i mean, i can. i'm just not sure how to verify it beyond "it compiles". hehe

stuck elbow
#

print the result?

raven canopy
#

@stuck elbow asked...and answered. ๐Ÿ˜†

/tmp/ccOqNwwR.s: Assembler messages:
/tmp/ccOqNwwR.s:45159: Error: instruction not supported in Thumb16 mode -- `muls r1,r3,r2'
/tmp/ccOqNwwR.s:45171: Error: instruction not supported in Thumb16 mode -- `muls r3,r3,r2'
stuck elbow
#

\o/

#

I see a soul in search of answers.

raven canopy
#

thankfully, Dean did finish the non-DSP-ASM addition functions. can probably work those into multipliers...

solar whale
#

I just tried CP 5.x master and 4.10 on a gemma M0 and it works OK, but the DotStar LED does not behave normally -- on RESET it flashes wildly (moslty reds) and then on entry to REPL goes to a sort of blue. Can onay else try this on a gemma M0 and see if you see the same .

stuck elbow
#

goes looking for his gemma

#

by the way, how do you pronounce it, gif or jif? ;-)

solar whale
#

mine is usually under a tft screen

#

i use a hard g - gif

raven canopy
#

"jif". i blame the peanut butter brand...

stuck elbow
#

so jemma?

raven canopy
#

for me, yep.

solar whale
#

not for me - gemma

stuck elbow
#

gem or jem?

solar whale
#

๐Ÿ˜‰

raven canopy
#

hehe. language is funny. english is the worst. gem == jem

stuck elbow
#

let's witch to Polish spelling, will be easier, dลผemma

#

@raven canopy so how would you write gem with a hard g?

#

ghem?

raven canopy
#

written, is g. pronounced as a soft g though (j).

stuck elbow
#

sure, but suppose it's a name

#

and you want it to be read with a G and not a J

raven canopy
#

๐Ÿค”

stuck elbow
#

gemme ;-)

solar whale
#

FWIW -- my trinket_m0 behaves normally -- and there is no challenge to the pronunciation.

stuck elbow
#

my gema does do the red/blue blinking while not in repl, but in repl it's blue

solar whale
#

very light blue...

#

good - it's not just me -- is this an "issue" or a"feature"

stuck elbow
solar whale
#

looks like mine

manic glacierBOT
solar whale
#

but the REPL color is not always the same -- kind of pink this time

#

I think the REPL color is just whatever it was flashing at the time.

#

'm getting a headache from looking at it -- I think I'll file and issue...

manic glacierBOT
manic glacierBOT
#

The example code is very helpful, thanks! Using the scanner library provides unique entries.
I'm pretty sure the byte order is reversed. I created a simple test that flips the byte order:

from adafruit_ble.scanner import Scanner
from binascii import hexlify

address_types = {
    0: 'PUBLIC',
    1: 'RANDOM_STATIC',
    2: 'RANDOM_PRIVATE_RESOLVABLE',
    3: 'RANDOM_PRIVATE_NON_RESOLVABLE'}

scanner = Scanner()
entries = scanner.scan(3)  # scan for 3 seconds

for e in ent...
meager fog
stuck elbow
meager fog
#

๐Ÿ˜ƒ

#

its a "little flora"

stuck elbow
#

even jewel is a deformed gemma, if you think about it

meager fog
stuck elbow
#

ah, your google translate link showed me italian

meager fog
#

it is italian

#

for flowerbud

stuck elbow
#

so in Italian it's jewel, but in English it's bud

meager fog
#

its both

stuck elbow
#

also, cat's eye

meager fog
stuck elbow
#

thanks

#

so it's from the same root as "generate"

manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
lone sandalBOT
solar whale
#

@tulip sleet nevermind -- ignore previous (now deleted) posts -- my bad...

manic glacierBOT
#

I think I may have spotted the issue, but would like some other
eyes to take a look if possible.
Here's what I see:
When playing .wav files, in audio_dma_setup_playback(), we find a free DMA channel (usually
channel 0) and store it in the dma structure. So, whenever we call audio_dma_load_next_block()
we use that stored channel. Now, when using the microphone we call
common_hal_audiobusio_pdmin_record_to_buffer(), which also looks for a free DMA channel
(again, it seems to always ge...

solar whale
#

@tulip sleet I tried to set the current_time via BLE with your "pairing" branch of the BLE repo on 5.0 Master. but I get this -- am I missing something? ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.0-128-g347fbb652 on 2019-08-03; Adafruit Feather nRF52840 Express with nRF52840

import time_ble
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "time_ble.py", line 3, in <module>
File "adafruit_ble/current_time_client.py", line 62, in init
NameError: name 'peripheral' is not defined

test code wasfrom adafruit_ble.current_time_client import CurrentTimeClient

cts_client = CurrentTimeClient()
cts_client.start_advertising()
while not cts_client.connected:
pass
cts_client.discover()
cts_client.pair()
print(cts_client.current_local_time)

tulip sleet
#

@solar whale there's a typo there I fixed but didn't push yet (because it's churning for other reasons):

def __init__(self, name=None, tx_power=0):
        self._periph = Peripheral(name=name)
        self._advertisement = SolicitationAdvertisement(peripheral.name, (self.CTS_UUID,), tx_power=tx_power)
        self._current_time_char = self._local_time_char = None

should be

solar whale
#

@tulip sleet thanks -- I thought that was it and tried it -- it gets beyond but as you noted then hangs -- no problem -- just wanted to make sure I was on the right path...

tulip sleet
#

Try this commit maybe. The current tip of ble-pairing probably doesn't work. I just pushed it for backup

#

I'm adding better BLE Descriptor support and the code is in flux

stuck elbow
#

cleans the flux with rubbing alcohol

solar whale
#

@tulip sleet --- OK -- I'll do some poking, but did not mean to pressure you -- I can wait until you are ready for testing.

tulip sleet
#

no pressure!

solar whale
tulip sleet
#

it was very satisfying ๐Ÿ˜ƒ

solar whale
#

now I need to understand what it all does ๐Ÿ˜‰

tulip sleet
#

CTS is unusual in that the peripheral is acting as a client instead of a server. So there's a special kind of advertisement, then we make a pairing request, and the central (the iPhone) does the connection

solar whale
#

pretty slick

manic glacierBOT
meager fog
#

@umbral dagger hihi ok scott submitted some feedback for the screenshot PR - plz check it out ๐Ÿ˜ƒ

solar whale
#

ugh -- don't ever name a test program time.py -- that was confusing....

drowsy geyser
#

Hi all. Text-only today.

#

Actually, just lurking

old smelt
#

Lurking today.

tidal kiln
#

lurking

turbid radish
#

lurking too

slender iron
raven canopy
#

Lurking. child taxi and day job...

river quest
obsidian compass
#

That's me holding the hallow wing ๐Ÿ˜„

#

Thanks for sending the circuitplaygrounds boards to hack, Phillip ๐Ÿ˜ƒ

meager fog
#

hi folks lurkin just text

river quest
onyx hinge
#

I very much want a pyruler

river quest
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

OK! Big news- Itโ€™s now possible to edit and save Python code on iOS to embedded electronics, CircuitPython USB devices! This is a follow up to our post about Appleโ€™s iOS 13 beta, which โ€ฆ

#

โ€œRISC architecture is gonna change everythingโ€
https://youtu.be/RL9yCWv7NS0
Weโ€™re excited for open silicon! If someone is working on a RISC-V microcontroller with built-in USB and a good chunk of RAM please let us know! We're looking forward to writing "CircuitPython snakes its way to RISC-V!"
https://blog.adafruit.com/2019/08/02/risc-architecture-is-gonna-change-everything-adafruit-joins-the-risc-v-foundation-risc_v-riscv-adafruit-adafruit/

added #risc-v topic in Discord, er, RISCord...

"RISC architecture is gonna change everything" .... "Yah, RISC is good."

โ–ถ Play video
Adafruit Industries - Makers, hackers, artists, designers and engineers!

โ€œRISC architecture is gonna change everythingโ€ โ€ฆ. โ€œYah, RISC is good.โ€ Hackersย (1995), accurately predicted the future, maybe :) Big news for us! Adafruit joins tโ€ฆ

onyx hinge
#

sign me up

river quest
drowsy geyser
#

I'm in. Particularly interested in compiling assembler to machine language.

river quest
#

HUG REPORTS FOR ALL!

slender iron
obsidian compass
#

๐Ÿ˜ƒ Thanks @slender iron

drowsy geyser
#

The cake is a lie.

obsidian compass
#

๐Ÿ˜„

timber mango
#

lurking

prime flower
#

welcome @pearl notch !

onyx hinge
#

(oops meant to hold that until my status updates)

slender iron
#

I see a model m!

swift arrow
#

I fixed an ISSUE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#

first one ever for me ๐Ÿ˜ƒ

errant grail
turbid radish
#

someone on Reddit was asking about the volume capability

errant grail
pearl notch
#

Please do publish something on that.

turbid radish
#

Adafruit has a new digital pot just out

tidal kiln
#

seattle "hot" is > 80F

errant grail
#

@turbid radish Saw that. It has some audio bias limitations that could confound what I'm doing.

obsidian compass
#

Mic not working, status update: Gonna try the MQTT lib tomorrow and see how it goes with local and remote broker. Also did some light painting with circuitplayground last week, and looking for a BLE board to work on ble projects .

pearl notch
tulip sleet
#

@obsidian compass we already have Feather nRF52840 for BLE via Arduino and CircuitPython, and more boards are in the works

errant grail
obsidian compass
#

@tulip sleet sure, I see. Not yet available here locally in India, if I need to import I think I'll wait for the new BLE circuitplayground one ๐Ÿ˜‰

stuck elbow
obsidian compass
#

she does ๐Ÿ˜ƒ

swift arrow
#

@slender iron pull request sent. Wow, my real first fix!! OMG I spent a week on it ๐Ÿ˜ƒ

onyx hinge
#

to paraphrase someone at pyohio, I'm giving you these review notes because I have a lot of confidence in you and want you to grow as a developer

#

@gilded cradle

gilded cradle
#

๐Ÿ˜ƒ

stuck elbow
#

it's about 90

swift arrow
#

I have even more respect for the CP team after that. You people are AMAZING!!

stuck elbow
#

frozen modules don't get updated without a clean

raven canopy
#

I've wanted to redesign that yaml for a while now... Using a stricter matrix would make it much more readble/maintainable.

solar whale
#

progress is not always forward ๐Ÿ˜‰

#

sorry -- I have to go AFK -- have great week ๐Ÿ‘‹

tidal kiln
onyx hinge
#

you could study how regions were implemented back in 68k macs, they could efficiently represent shapes with gaps

pearl notch
#

Great being with you all.

errant grail
#

Thanks everyone!

obsidian compass
#

Have a great week ahead

drowsy geyser
#

Thanks everyone!

stuck elbow
#

graphical? blasphemy!

raven canopy
#

I could not get Segger Embedded Studio to work...

onyx hinge
#

Is there a reason for the particular day chosen as circuitpython day?

tulip sleet
#

8/8 looks like two snakes

raven canopy
#

Easy "snek art"

onyx hinge
#

okay ๐Ÿ˜ƒ

raven canopy
#

@tidal kiln run a Windows vm and use atmel studio 7?

#

๐Ÿ˜†

#

I found that using a breakpoint file, and source at the start makes line number woes a non-thing.

#

optimized out ๐Ÿ˜ก

pearl notch
#

Re my status in the voice chat, I can now read the accelerometer values from a connected โ€œhostโ€ computer running this:

import serial  # pyserial

s = serial.Serial('/dev/cu.usbmodem14131', 115_200)
print(s)
for n in range(100):
    print([float(s) for s in s.readline().split()])

From there Iโ€™ll feed them to the p5.js sketch via Flask.

manic glacierBOT
slender iron
#

@raven canopy looks like we're leaking the api key in these errors too ๐Ÿ˜ฆ

subtle sun
#

@slender iron Looking through your EPD displayio work. Do the drivers support both greyscale and color displays? Is this controlled through the parameters passed to the initializer? Would be happy to help you test on some epaper displays i have lying around

slender iron
#

ya, it should support both

#

I don't have a grayscale display to test with. only white/black and white/black/red

#

I think the params to control it now are third_color and write_color_ram_command

subtle sun
#

Great

#

@slender iron maybe i misunderstood but when i said greyscale i meant white/black

slender iron
#

kk, just checking ๐Ÿ˜ƒ

#

did you see the drivers I pushed already?

#

lemme find my sample code

subtle sun
#

Yes.
what resolution / format is "Triangulo_HSV.bmp"?

slender iron
#

indexed bmp

subtle sun
#

Thanks,
ill try to compile and run it

slender iron
#

great!

#

it'll change a bit more before it's committed but it's a start

raven canopy
#

@slender iron ๐Ÿ˜ฌ I'll deep dive it tonight. I've noticed the uptick over the past few weeks, but haven't been checking it every day. Just need to narrow down the root, be it GitHub, Travis, or the modules.

#

@slender iron @tulip sleet in reference to speeding up builds, have we tried using ccache before? It's available on Travis, and at this point in my research (phone) seems compatible with gcc-arm-none-eabi.

slender iron
#

@raven canopy I'm deep in fixing the key leaking at least. will have a PR shortly

#

it's kinda hairy but should work

#

already revoked the existing key

raven canopy
#

Not sure what my phone just did there...

tulip sleet
#

@raven canopy ccache looks very interesting, and easy to use

#

it looks like it should handle all the cases of different compiler options, since it's checking that the command line matches

subtle sun
#

@slender iron tried compiling for nrf but i see you have only implemented atmel samd support so far. I dont have a samd board on hand so ill continue on it tomorrow when i get hold of one.

slender iron
#

it shouldn't be too bad to get working

#

none of the new code uses anything port specific

#

may just need a build file tweak

tulip sleet
#

@raven canopy ccache sped up a clean compile of the same board twice from 1:54 to 0:36, but it did not speed up two similar board caches (metro m4 then feather m4). This is probably because the board id is on pretty much every compile command line

#

right now the same-board compiles are only one language to another, and we already skip make clean on those compiles

#

we might think about trying to make more compiles board-independent

manic glacierBOT
slender iron
exotic pumice
#

#progress

subtle sun
#

@slender iron Got it working on an nrf based board with a ssd1673 display. When using an il0373 display the result is a fuzzy display (I am guessing something is wrong with the pixel format). Both displays are black/white.

pearl notch
onyx hinge
#

@pearl notch wow ! that was quick

#

@magic sparrow I like how it starts out simple on the cpx and gets progressively more complicated as you go to the flask and javascript parts of the project

swift arrow
#

Is there a command to print the amount of free ram?

exotic pumice
#

gc.mem_free

manic glacierBOT
swift arrow
#

If you edit a comment you made in a github Issue.. Does everyone get notified each time you edit it?

#

I made some changes to my comment and saved.. then made some more..saved.. then made some more.. about ten times.. Did I just SPAM everyone on the list?

solar whale
#

@swift arrow no, only the initial post is sent out. Edits do not get broadcast. No problem!

swift arrow
#

awesome

#

thanks

manic glacierBOT
#

Hmmm, short of the usual checks (is your power supply good enough? Is the 'wing seated properly? Does it still do it with the latest release? Can we try over with new hardware?) I'm stumped. One thing you could try is to plug an ethernet cable into a port you can monitor and check that you can see DHCP discovery packets being sent while waiting for ifconfig() to finish, but I'm clutching at straws here.

manic glacierBOT
#

Sounds suspicious @DavePutz ! I think you are right about contention.

  1. I think we'll want to use channel 0 for recording and 1 for playback because lower numbers get higher priority. I'm not sure what has to happen for that though.

  2. Load next block is loading more of the sound from the filesystem so the sound keeps playing because we can't store it all in memory.

Perhaps @jepler and @deshipu have ideas of how to fix this too.

manic glacierBOT
pearl notch
#

Is it too late to put something in tomorrowโ€™s newsletter, and is that a good place for my accelerometer to 3D animation demo video and code? If yes and yes, into what section should a short note go?

manic glacierBOT
manic glacierBOT
#

I think @DavePutz is on the right track, if both devices ever try to use the same channel at the same time, something bad will happen. Why isn't the expected protection against this working?

I started looking into this with debugging prints and the first thing I noticed is that dma_disable_channel can be called with an out-of-range channel number if audio_dma_stop is called twice, and it frequently is.
However, this doesn't seem to be leading to this behavior.

Next, I started track...

onyx hinge
#

well that's me up past bed-time

manic glacierBOT
manic glacierBOT
#

@kattni @rhooper I am taking another look at something very similar to #770 which both of you were involved in.

How the current PWMOut determines if the error says "All Timers for this pin are in use" and "All timers in use" is still not clear in my view.

For some reason the TCCs are treated differently to the TCs under this arrangement. You can have a situation where all the TCC timers are used, but it won't say that. It will just say "All timers in use".

Can we change what it...

manic glacierBOT
#

It is possible for this routine to expand some inputs, and in fact it does for certan strings in the proposed Korean translation of CircuitPython (#1858). I did not determine what the maximum expansion is -- it's probably modest, like len()/7+2 bytes or something -- so I tried to just make enc[] an adequate over-allocation, and then ensured that all the strings in the proposed ko.po now worked. The worst actual expansion seems to be a string that goes from 65 UTF-8-encoded bytes to 68 compr...

tulip sleet
#

@pearl notch newsletter is finished already, but thereโ€™s always next week. If you have a suggestion for the newsletter post it here and tag @turbid radish

agile saffron
#

First of all hi - Iโ€™m Scott (from Scotland) and Iโ€™m a hobbyist and STEM ambassador / Code Club Leader, and i love CircuitPython! I also love Stranger Things, so I pulled this together for CircuitPython day. Uses the precision rtc featherwing and an M4 express. Little bit more work to do on the enclosure cause Iโ€™m getting a bit of bleed between letters, but Iโ€™m super happy about how itโ€™s come together.

main meteor
#

I was thinking of building a full sized one using the GE addressable holiday lights, that's cool. It's amusing how the lense flare makes it look almost as if there is a laser beam illuminating it.

agile saffron
#

Ha, Iโ€™ve got a 3 year old so lasers have been banned (for now!) in my house. I do love a laser though....

raven canopy
#

@agile saffron that's awesome!

agile saffron
#

Thanks sommersoft!

pastel panther
#

@agile saffron great job! Was that Stranger Things inspired?

main meteor
#

I'm guessing that's what the "I also love Stranger Things" aside was pointing out.

agile saffron
#

Oh yeah definitely siddacious

pastel panther
#

Oh derp, missed that :)

agile saffron
#

I also forgot to say it was a clock in that description, I got too excited ๐Ÿ˜€

craggy galleon
#

Great newsletter! ๐Ÿ˜ƒ

pastel panther
agile saffron
#

Oh cool thanks siddacious Iโ€™ll have a look at that tonight!

swift arrow
#

@idle owl : Just listened to your PyOhio talk. It was really good and inspirational. Awesome job!

#

and congrats on finding your passion and dream job!

manic glacierBOT
idle owl
#

@swift arrow Thank you so much!

graceful heart
#

I still have to listen to that, been meaning to!

subtle sun
#

@slender iron Would you accept a PR making the same changes you made for the atmel-samd port to the nrf ParallelBus implementation? This is what was missing yesterday to get the EPaper working on my nrf board

exotic pumice
#

does anyone know anything about sercom usart intflag rxc bit?

onyx hinge
#

@subtle sun we would be happy to see a PR. I have been wanting an excuse to get an e-ink board, being able to help you test it on nrf would qualify right?

exotic pumice
#

basically the rust hal we've got is checking if any data has been received before it does a read but the bit never ends up set

#

didn't see anything in the errata

#

does that only work if you're doing interrupts?

onyx hinge
#

Datasheet doesn't seem to state that INTFLAG.RXC depends on the related interrupt actually being enabled

exotic pumice
#

yeah I was looking at that

#

I think I disabled it when I meant to enable it

#

there's an intenset there

#

writing 1 disables the rxc interrupt, value 1 - interrupt is enabled

#

they're all like that though

#

is it talking about reads versus writes?

#

oh derp that's intenclr

tulip sleet
#

there are registers that you write 1's to to clear stuff, e.g. INTENCLR

exotic pumice
#

jeez I'm not in the right headspace for datasheet reading lol

tulip sleet
#

the screenshot above from the datasheet is from a page that describes other bits that you clear by writing 1's to

exotic pumice
#

yeah I just realized

slender iron
#

@subtle sun yup, definitely as @onyx hinge said

subtle sun
#

@slender iron I opened a PR to your repo.

I mentioned that when trying a B/W IL0373 display (GDEW029T5) the display just fills up with a mix of what seems to be a random pattern of pixels.
I think this is because the driver start sequence configures tri color support

manic glacierBOT
#

I don't think there is a reason. It sounds like you have an improvement of
the error messages.

On Tue, Aug 6, 2019 at 3:35 AM wallarug notifications@github.com wrote:

@kattni https://github.com/kattni @rhooper https://github.com/rhooper
I am taking another look at something very similar to #770
https://github.com/adafruit/circuitpython/issues/770 which both of you
were involved in.

How the current PWMOut determines if the error says "All Timers for this
pin are in use"...

slender iron
#

@subtle sun yup, I saw. please make it to the adafruit repo directly. for the driver, feel free to add logic to patch the init sequence if third_color is provided. (Do you think highlight_color is a better name?)

subtle sun
#

@slender iron My code is based on your branch which you haven't pushed to the adafruit repo yet.

Ill try playing with the driver to try and get it working with this display and then see how this should be solved.

manic glacierBOT
#

Here is some python code that reproduces reliably for me. Note that I think the use of the Neopixel code may be needed, as in my tests that generated a lot of gc_allocs and gc_frees - possibly related??
import array
import math
import time
import microcontroller
import audiobusio
import board
import gc
from adafruit_circuitplayground.express import cpx

Exponential scaling factor.

Should probably be in range -10 .. 10 to be reasonable.

CURVE = 2
SCALE_EXPONENT = math.pow(10, ...

slender iron
#

@subtle sun ah right! I'll pull it in.

subtle sun
#

Thanks

tidal kiln
#

@slender iron thanks for TCA merge. i'll take care of version bump, release, issue close, feed the cat, do the dishes, etc.

slender iron
#

@tidal kiln thanks!

lone sandalBOT
manic glacierBOT
onyx hinge
#

Is there any remotely feasible way to use my swd debugger on a cpx ?

idle owl
#

The dots on the back, I thought.

onyx hinge
#

oh I see 'em now

#

OK, if it comes to that! First, I just want to see if I can reproduce #1908

#

and then maybe my fix will fix it without trouble

#

nope, bug still happens with my fixes, drat.

manic glacierBOT
manic glacierBOT
#

next guess, which it looks like has solved the problem, but not sure if it's cumulative with other local changes:

@@ -292,6 +296,7 @@ void audio_dma_stop(audio_dma_t* dma) {
         audio_dma_disable_channel(dma->dma_channel);
         disable_event_channel(dma->event_channel);
     }
+    audio_dma_state[dma->dma_channel] = NULL;
     MP_STATE_PORT(playing_audio)[dma->dma_channel] = NULL;
     dma->dma_channel = AUDIO_DMA_CHANNEL_COUNT;
 }

Theory: nothing is clearing ou...

swift arrow
#

I need to "borrow" some crc makign code from https://github.com/hazelnusse/crc7/blob/master/crc7.cc .. but there is no license. It's for the adafruit_sdcard library. I do not see any license there. If people put stuff on github and make it public.. is that like an understood MIT license?

#

Sorry total newb here.. How do you handle that kind of thing? I will be converting his c++ code to python.

exotic pumice
#

no license is generally all rights reserved

#

afaik

#

but if you make significant changes it might not matter

#

IANAL

swift arrow
#

I'm not seeing a way of contacting the author.. hmmm...

exotic pumice
#

you can probably get his email out of git

swift arrow
#

thanks!

errant grail
#

@pearl notch : the example of a manual volume control for the Feather M4 Express is shown here. It can control the output of the two DACs by changing the DAC reference voltage through the AREF pin. WARNING: remove the trace between 3V and AREF on the Feather board before attaching anything to the AREF pin. Don't connect any voltage to the AREF pin greater than the 3V provided by the Feather or lower than 0V (no negative voltage). Hope to have a full explanation on the repo page later tonight. https://github.com/CedarGroveStudios/AD9833_ADSR

GitHub

ADSR Envelope Extension for Precision Waveform Generator FeatherWing - CedarGroveStudios/AD9833_ADSR

pearl notch
#

@errant grail Thanks. My interest in ADSR envelopes has so far been with web browser oscillators. Well, I think I played with it on my Commodore 64โ€™s SID chip.

errant grail
#

@pearl notch You're welcome. I've been focused on electronic music with Eurorack modules lately. It's pretty easy to find an envelope generator in the module format, but I wanted to brew my own.

onyx hinge
#

@swift arrow if you study the code and then write your original code, the license if the code you studied is not important, IMHO. But if you have any concerns, there are sure to be other implementations to study.

swift arrow
#

The author gave me permission so I am covered ๐Ÿ˜ƒ

#

and I am converting from C++ to Python.. and some slight modifications

manic glacierBOT
manic glacierBOT
lone sandalBOT
agile saffron
#

@errant grail the adsr trick is really cool, Iโ€™ve done a few things to control a modular with pwm on an Arduino but itโ€™s always a bit steppy, this looks like a great solution.

errant grail
#

@agile saffron Thanks. Had to wake up my trig skills to smooth the envelope. Good news is that 64-step amplitude resolution seems to be enough.

#

Bad news is that the AREF voltage can't go below about 0.5v without distorting the signal. Going to try a digital potentiometer or two to see if that works better.

drowsy geyser
#

@errant grail When I first read that my brain read "64-bit amplitude resolution" and I thought, "I would hope that's enough!"

errant grail
#

Ha! Might take a while to generate that ramp using CircuitPython!

drowsy geyser
#

Right? ๐Ÿ˜ƒ

errant grail
#

My first test was 10 steps followed by 32. The artifacts mostly disappeared with 32 so I doubled it.

drowsy geyser
#

Nice!!!!

errant grail
#

The digital potentiometer I'm planning to use has 256 steps. Plenty to choose from.

drowsy geyser
#

Oh yes. That will be good. ๐Ÿ˜ƒ

#

As for 64-bit resolution, I could tell a story about my son calling me on a sat phone from <insert far away land> and asking for a "10 digit grid reference" for a particular part of a particular building.... ๐Ÿ˜„

errant grail
#

Yikes.

drowsy geyser
#

Obviously can't go into details, but I'm sure you could use your imagination.

errant grail
#

Yes, I did. Two or three scenarios.

drowsy geyser
#

Let's just say there have been numerous interesting sat phone calls. LOL.

onyx hinge
#

@errant grail yeah, I checked out the datasheet (for samd21, it was handy) and the minimum guaranteed external reference voltage is 1.0, so you're stressing it a bit to go to 0.5 (40.9.4 in http://ww1.microchip.com/downloads/en/DeviceDoc/SAMD21-Family-DataSheet-DS40001882D.pdf)

manic glacierBOT
#

This includes a fix which directly addresses the original problem, as well as some further fixes for other weirdness I noticed along the way. In particular, while I saw some spurious soft-resets with only the first fix, I believe the change to audio_dma_stop somehow has the side effect of fixing some spurious soft resets I was seeing during testing. Or, at least, they changed from 1 per ~300s to <1 per 30,000s while running the #1908 reproducer.

Testing performed: Ran the reproducer scr...

solar whale
main meteor
#

Let's see, 3.3V with 64-bit resolution, that would be 0.000000000000000179 picovolts per step, or 0.179 yoctovolts. Given that the thermal noise for only 50ฮฉ with only 1Hz of bandwidth would be around 900 picovolts (5000000000000000000 times as much), most of those bits would be utterly lost.

tulip sleet
#

@solar whale thanks - I edited the example..current_time is right. It will be in the next PR. Debugging a bunch of changes to bleio at this very minute.

solar whale
#

@tulip sleet I tried the example with an Android phone but it failed -- is is only for the IOS app?

tulip sleet
#

i think Android phones may not do CTS. Did you pair but then it did nothing, or did it crash?

solar whale
#
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.0-116-gee518b914 on 2019-08-05; Adafruit Feather nRF52840 Express with nRF52840
>>> import time_ble
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "time_ble.py", line 7, in <module>
  File "adafruit_ble/current_time_client.py", line 99, in discover
OSError: Unable to discover service
>>> 
```  did not ask for pairing
#

failed when I connected

#

no need to send time on it now -- just an FYI

tulip sleet
#

could you post time_ble.py here?

solar whale
#
from adafruit_ble.current_time_client import CurrentTimeClient

cts_client = CurrentTimeClient()
cts_client.start_advertising()
while not cts_client.connected:
    pass
cts_client.discover()
cts_client.pair()
print(cts_client.current_time)
#

works fine with IOS -- asks for pairing

#

Android app was older -- updating...

tulip sleet
#

it looks like the phone responded to the advertisement and connected, but then since it didn't have time, the client didn't know what to do. I should probably have discover return a boolean or throw an exception. The advertisement says "please connect if you have this service", so I don't know why the phone connected.

#

I have a recent Android tablet and will see what happens

solar whale
#

OK - no problem -- BTW updated Android App app to 3.1 - same result

tulip sleet
#

is this the bluefruit app or some toher app?

solar whale
#

Adafruit Bluefruit

tulip sleet
#

the bluefruit app doesn't provide the time -- it's provided by the OS. So did you connect to the CIRCUITPY peripheral and then it failed? That would explain it

#

you don't need to be running the bluefruit app at all

#

i don't know if android does CTS

solar whale
#

it failed when I tried to connect the Bulefruit app... BTW -- Nordic nRF Connect works fine on IOS

#

on IOS I have to run the app to get the pairing request

tulip sleet
#

the scenario is:

  1. '840 advertises for a central that provides CTS
  2. the central (iOS itself) conencts and says, yes, I do that
solar whale
#

I run the app, connect then is asks to pair

tulip sleet
#

so, I am not connecting via the app, I am looking in iOS Settings->Bluetooth, in the device list. I start the cts client advertising, and then CIRCUITPYxxxx shows up in the device list. I touch that in Settings->Bluetooth, and then the pairing request shows up, and then it moves into the list of known/connected devices. No other bluetooth app is running

#

sorry for the confusion. There's a brief view of this in the S&T demo I did a couple of weeks ago

#

I should put a description of this in the library example docstring

solar whale
#

ok - cool! that works too! -- it also works if you start the Bluefruit App or the nRF Connect App

tulip sleet
#

that might be becuase the nRF connect app also does CTS, as a demo. The idea was to access the native service provided by iOS

solar whale
#

makes sense!

tulip sleet
#

eventually we might do ANCS (Apple Notification Client Service) so you could see notifications that show up on your iPhone also on the '840. That's the way FitBit, etc. show your texts. But it's a lot more complicated

#

e.g. homemade apple watch equivalent

#

(well, hardly equivalent)

solar whale
#

cloae enough! I hope I can learn enough to help...

tulip sleet
#

sure, but it did take me a long time fully understand what is going on with BLE. it is complicated and the protocol is not layered in a way that hides the compliations, unfortunately

solar whale
#

I need to go back an read/reread Ktowns book -- BTW just tried using the Bluetooth settings s on the Android and it does a bit better ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.0-116-gee518b914 on 2019-08-05; Adafruit Feather nRF52840 Express with nRF52840

import time_ble
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "time_ble.py", line 7, in <module>
File "adafruit_ble/current_time_client.py", line 99, in discover
OSError: Unable to discover service
sm: 1, lv: 2
PAIR_PAIRED
Pairing succeeded, status: 0x0000

tulip sleet
#

so it appears Android does not provide CTS, and I should have discover() return false, and the program should report no CTS is available and not try to pair.

solar whale
#

all in good time ๐Ÿ˜‰

tulip sleet
#

i have read the relevant parts of ktown's book several times, and it did not completely sink in until I had to code it. not his fault

solar whale
#

For now, it's great to have your work to poke and prod. Thanks!

old smelt
#

f-strings are not supported in CP, correct? For some reason, I was thinking that I saw them in some libraries a while back, but using them in my code caused errors. Just making sure I'm not missing something.

stuck elbow
#

no, they aren't

#

there should be one way etc.

cerulean pawn
#

@stuck elbow hey, in my PR for circuitpython-stage I have a copy of stage.py because the audioio module for nrf port is named audiopwmio, so it doesn't work without modification

#

I've updated it anyway now that @onyx hinge's PR for audio on nrf port is merged

stuck elbow
#

@cerulean pawn yeah, I saw your comment, I'm not sure yet how to best handle it, but moving the Audio class out to the ugame.py is one possible option

old smelt
#

Thanks @stuck elbow

stuck elbow
#

@cerulean pawn sorry it's taking long to answer, I'm a bit sick recently

cerulean pawn
#

no problem @stuck elbow, I added a copy of both the files in circuitpython ni the frozen directory, added your license, i hope that's fine for now, until we have a better solution

stuck elbow
#

thanks

#

by the way, did you get it working frozen?

#

there were some problems with that, iirc?

cerulean pawn
#

yeah, it's working for me, testing it right now. i had issues but not in circuitpython. the board's LDO couldn't supply enough current to the audio amp

stuck elbow
#

oh, I see

cerulean pawn
#

works fine if it is powered directly via usb

stuck elbow
#

yeah, the amp on the ยตGame makes the screen dim a bit :P

cerulean pawn
#

but will be a problem if it is powered via battery. since Vbat is not exposed on blip header :/

#

should've used a DC/DC reg. which can supply more current than what the LDO can

#

.. oh wait, it's not, frozen is still not working :/ I had connected only speakers and was hearing sounds, so I assumed it was working (had forgotten about this). Screen is blank, so LCD initialization did not happen

errant grail
#

@onyx hinge Thanks for finding that! I combed the SAMD51 datasheet until I could comb no more. Never found it .

indigo wedge
#

it being that MCU

main meteor
#

Yow, 600MHz for <$20! While the branch prediction could make it vulnerable to Meltdown/Spectre type attacks, I don't envision having partitioned data on a SBC like this, so I doubt it's much of a concern.

indigo wedge
#

There's also variants without flash built in but still with 1MB RAM, that would be interesting cause then you can just use external flash for both CP and the MSD

stuck elbow
#

@main meteor I don't think you have to worry about memory attacks on microcontrollers that have no threading and no memory protection anyways

#

I mean, in a way they are vulnerable to those attacks by design without any special bugs :)

ruby lake
#

the real question is, eta for cp on that thing ๐Ÿ˜‰

main meteor
#

Sooner if we start porting it ourselves, I guess ๐Ÿ˜ƒ

slender iron
#

@ruby lake I've chatted with paul about it and he's interested. I'm super interested too since it's high speed usb

#

@main meteor please do!

main meteor
#

Hmm, I'll have to dig up an appropriate compiler chain, and I don't think we have a ports directory for NXP iMXRT chips yet.

#

I suppose I can start with the compiler that's in the Teensyduino add-on.

stuck elbow
#

it's still an arm, so not too exotic

#

not like the xtensa, anyways

main meteor
#

Hmm, I can't find Teensy 4.0 support in Teensyduino.

solar whale
#

@tulip sleet playing with the UART client -- this works OK with the ble_uart_echo_test.py example import time from adafruit_ble.uart_client import UARTClient uart_client = UARTClient() uart_addresses = uart_client.scan() if uart_addresses: uart_client.connect(uart_addresses[0], 5) else: raise RuntimeError("No UART servers found.") while uart_client.connected: message=input("enter message: ") uart_client.write(message) # get echoed response response = uart_client.read(len(message)) print(response) here is a test -- echo server running on a aparkfun nrf52840 mini ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.0-116-gee518b914 on 2019-08-05; Adafruit Feather nRF52840 Express with nRF52840

import ble_uart_client_test
enter message: yay
b'yay'
enter message: it works
b'it works'
enter message: how about a long message - over 20 buytest
b'how about a long message - over 20 buytest'
enter message:

tulip sleet
#

@solar whale thanks for verifying on other than just my own test program ๐Ÿ˜ƒ

raven canopy
stuck elbow
#

it's cortex-m7

solar whale
#

the example in uart_client.py needs some updating ๐Ÿ˜‰

tulip sleet
#

I just pushed a new working version to dhalbert/circuitpython branch ble-pairing along with dhalbert/Adafruit_CircuitPython_BLE branch pairing. I know this works with the RGB test programs

stuck elbow
#

by the way, openmv has micropython running on cortex-m7

solar whale
#

OK - thanks -- I'll update

tulip sleet
#

there are some doc updates but maybe not done yet

solar whale
#

np

tulip sleet
#

but please do point out doc issues, since it saves me review time ๐Ÿ˜ƒ

solar whale
#

@tulip sleet ok -- updated CP and BLE -- stil works with my uart test ... will try more

#

and the CTS demos still work!

manic glacierBOT
#

Hi, when I try to run the circuitpython code below for an i2c of vcnl sensor and crickit robot on feather m0 express it gives me an ''SCL in use" error. Do you have an idea about how can I fix that?

import time
import adafruit_vcnl4010
import board
import busio
from adafruit_crickit import crickit

i2c = busio.I2C(board.SCL, board.SDA)
while not i2c.try_lock():
pass
print("I2C addresses found:", [hex(device_address)
for device_address in i2c....

manic glacierBOT
#

When you import the crickit library, it sets up the I2C bus:
https://github.com/adafruit/Adafruit_CircuitPython_Crickit/blob/master/adafruit_crickit.py#L382
So when you try to do it again with:

 i2c = busio.I2C(board.SCL, board.SDA)

It hits that error since the pins, both SCL and SDA, are in use. It only mentions SCL since that's the first one it tries to use.

Also, you don't need to worry about doing the lock and the scan. So change all this:

i2c = ...
subtle sun
#

@slender iron I managed to get the IL0373 B/W display working.
It involved a change to start sequence (panel setting command data) and changing the write_black_ram_command to the correct command for the B/W mode.

Can i assume the display is B/W if the user doesn't pass third_color?
Should the default background color be black or / white?

manic glacierBOT
#

Firstly, thaks for the quick response!

I inverted the code into the way you said, now I am getting the same error
but for SDA.

Error:

Traceback (most recent call last):
File "code.py", line 7, in <module>
ValueError: SDA in use

Code:

import time
import adafruit_vcnl4010
import board
import busio
from adafruit_crickit import crickit

sensor = adafruit_vcnl4010.VCNL4010(board.I2C())
#i2c = busio.I2C(board.SCL, board.SDA)
#while not i2c.try_lock():

pass

#i2c.unlock()
#sensor = adafru...

rigid dune
stuck elbow
#

But is this art? ๐Ÿค”

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I'm preeeeeeetty sure it got ripped out of (or at least disabled in) CircuitPython, but MicroPython ships ujson as a C module. YAML is technically a superset of JSON, so if this was implemented as a C core module, you've got something of a start to base off of: http://docs.micropython.org/en/latest/library/ujson.html https://github.com/micropython/micropython/blob/master/extmod/modujson.c

That said.... YAML is a finnicky, (in my opinion overly) flexible beast and trying to port PyYAML ...

slender iron
#

@subtle sun ya, I'd assume black/white without third_color or whatever it gets called

manic glacierBOT
swift arrow
#

if you issue a pull request https://github.com/adafruit/Adafruit_CircuitPython_SD/pull/19 and then make some changes (added dynamic CRC) like a reviewer suggested.. How do I make it so my new "adafruit_sdcard" is the one that is pulled?

stuck elbow
#

just push it

#

to the same branch

swift arrow
#

and how do I make it so my old pull request changes are gone from my branch.. I want to like cancel the changes and use my new file as the changes against the master branch

#

do I need to destroy my fork of it.. and then refork it and push my changes?

stuck elbow
#

rebase interactively against the master and remove the previous commits, and then push -f

swift arrow
#

is that doable via the web gui?

stuck elbow
#

I don't think so

swift arrow
#

doh..

stuck elbow
#

something like git rebase -i HEAD~5 and follow the instructions

#

you can remove commits, squash the changes into one commit, etc.

swift arrow
#

I'm totally new to all this.. so I only have the web setup so far

stuck elbow
#

then how do you test it?

swift arrow
#

I create a fork via the web gui.. then download zip of the lib.. then make changes/ test on my board.. then upload changes to my fork.. and do a pull request

#

Once I get this change finished.. then I am going to make a linux VM and do my stuff there the "proper way"

manic glacierBOT
stuck elbow
#

@swift arrow just make a clone instead, that is much more comfortable

sly falcon
#

it doesn't cover rebase'ing, but I would argue that's an advanced use so probably not apropos for that guide

swift arrow
#

@stuck elbow a clone instead of a fork?

stuck elbow
#

a fork and then do a clone of your fork to your local machine

#

you already have a fork, so just clone it, that guide should help you

pearl notch
#

@slender iron Iโ€™m pleased to see stuff like this works in CircuitPython: ', '.join(('{:>6.2f}'.format(a) for a in accel_vals))

slender iron
#

@pearl notch thank micropython for that!

pearl notch
#

Ah, noted!

sudden coral
#

On my ever-growing list of "ugh, one day I will make time for contributing this" stuff, I'd love to add PEP-498 to CircuitPython (or upstream since they've discussed it https://github.com/micropython/micropython/issues/2415) - https://www.python.org/dev/peps/pep-0498/

@pearl notch That'd trim your example even further to ', '.join((f'{a:>6.2f}' for a in accel_vals)). Code golf! ๐Ÿ˜ƒ

pearl notch
#

Yeah, f strings would be great. I did discover they arenโ€™t implemented.

manic glacierBOT
sharp nymph
#

I just heard about the new Teensy 4.0 board, and the first thing I thought was "this board needs circuitpython"

manic glacierBOT
#

I wish I had more specific information , but I am getting repeated Hard Fault crashes to Safe mode on a PyPortal with the current Master.


You are running in safe mode which means something unanticipated happened.
Looks like our core CircuitPython code crashed hard. Whoops!
Please file an issue at https://github.com/adafruit/circuitpython/issues
 with the contents of your CIRCUITPY drive and this mess...
#

just to be sure, I recloned the CP repo and rebuilt sot remove the "dirty" buult -- it was not getting the correct tag for tinyusb. rebuilt and still have same crashes

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

You are running in safe mode which means something unanticipated happened.
Looks like our core CircuitPython code crashed hard. Whoops!
Please file an issue at https://github.com/adafruit/circuitpython/issues
 with the contents of y...
#

here is another way to trigger the Hard fault:
Hard reset:
run slide show:

import os
import board
import busio
import digitalio
import storage
import adafruit_sdcard
from adafruit_slideshow import PlayBackOrder, SlideShow

""" If you want to use an SD card to store the images: """
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
cs = digitalio.DigitalInOut(board.SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/s...
swift arrow
#

my travis build is failing with..

#

************* Module adafruit_sdcard
C:484, 8: Consider using enumerate instead of iterating with range and len (consider-using-enumerate)
R:459, 4: Method could be a function (no-self-use)

#

hmmmm

idle owl
#

@swift arrow The second one, give it a @staticmethod decorator should fix it up. First one... which version of pylint are you using?

swift arrow
#

I cleaned it up.. trying again ๐Ÿ˜ƒ

#

omg 1 failure..

#

C:484, 4: Consider using enumerate instead of iterating with range and len (consider-using-enumerate)

#

umm.. looks like 1.9.2

#

to make my function generic I need it..

#

for i in range(len(message)):

#

Wohooooooooooooooooooooo!! it passed this time ๐Ÿ˜ƒ

#

@idle owl I need to read your learn guide on contributing and github

onyx hinge
#

Hm I am puzzled by the errors in my pull request ๐Ÿ˜ฆ

#

/tmp/cc0uBCYs.lto.o: In function `run_background_tasks.part.0': <artificial>:(.text.run_background_tasks.part.0+0x68): undefined reference to `audiosample_get_buffer' <artificial>:(.text.run_background_tasks.part.0+0x17e): undefined reference to `audiosample_reset_buffer'

onyx hinge
#

Adding the line audio_dma_state[dma->dma_channel] = NULL; in audio_dma_stop causes this link error in run_background_tasks.

#

It sort of looks like the guard on the call to audio_dma_background in background.c is not right

#
+    #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO
     audio_dma_background();
``` seems more like it
exotic pumice
#

Oh oops I was scrolled up

onyx hinge
#

testing plan: buildng all satmel-samd boards, making sure audio still works on the cpx I have handy

#

audio still works so that's good (no surprise there), and all boards building so far

manic glacierBOT
raven canopy
#

@slender iron after your comment on "translations may not have full coverage" on AAE tonight, i immediately thought about writing a translations_coverage.py. should be simple enough. just not sure of its actual usefulness, and where the info would "live".

#

@onyx hinge question: would it be normal for a wave file downsampled from 16K/16bit signed to 8K/8bit unsigned, to sound...crunchy? according to the actual values, i've got mixer voice working for 8K/8bit correctly (or close). but the audio sounds horrendous.

onyx hinge
#

@raven canopy I would expect it to be "not too bad". There might be a little more static hiss or less clarity, but ... "crunchy" or "crackly" seems like a bug waiting to be found and squashed

raven canopy
#

๐Ÿ˜ฆ that's what i was thinking too. thanks for the second opinion!

onyx hinge
raven canopy
#

another sad point: i'm testing with a piezo ๐Ÿ˜†

onyx hinge
#

Is jerryn = jerryneedell on github?

raven canopy
#

yep

manic glacierBOT
solar whale
#

@onyx hinge yup ==

pearl notch
manic glacierBOT
#

Running some diagnostics this looks like a crash due to memory fragmentation. I believe this is due
to having 'import' statements scattered throughout the code. If all imports are placed at the top of the Python script things seem to run OK. i.e.:

import board
import digitalio
import time
from adafruit_debouncer import *
import neopixel
import os
from DiscJockey import *
import pulseio

In addition to helping memory management, this is just good Python programming practice....

manic glacierBOT
#

ok -- much simpler example

import board
import displayio
import terminalio
from adafruit_display_text import label
 
display = board.DISPLAY
 
# Set text, font, and color
text = "HELLO WORLD"
font = terminalio.FONT
color = 0x0000FF
 
# Create the tet label
text_area = label.Label(font, text="HELLO WORLD", color=0x00FF00)
 
# Set the location
text_area.x = 100
text_area.y = 80
 
# Show it
display.show(text_area)

runs ok after hard reset

crashes to hard faul...

slender iron
#

@raven canopy it would to have a sort of dashboard for it. I wonder if we need to have a string freeze step for releases though so translators have a chance at 100%

agile saffron
#

Happy CircuitPython day everyone!

manic glacierBOT
manic glacierBOT
#

The linker error that travis found is a little weird, because it concerns an undefined symbol that I didn't undefine or add references to, inside a function that I didn't modify. That said, the fix I found and which is now reflected in this PR is to change one #if-guard, and add a second, that is keyed off the CIRCUITPYTHON_XXX defines for audioio and audiobusio, instead of the rather dubious (but battle-tested!) condition that was formerly there.

#

I've got a stable release deployed. I cloned the community bundle, then successfully did the git submodule add ... command. Now I'm stuck. the command that @tannewt used in the picture of the last page of the sharing guide doesn't work (not sure where the build-bundle.py is located). Then I tried circuitpython-build-bundles --filename_prefix circuitpython-community-bundle --library_location libraries --library_depth 2 from the bundle's readme, but I get a `Permission denied: 'C:\Users\y...

marble hornet
#

@plucky flint is the desktop pypercard working ontop of kivy?

marble hornet
#

that's so cool

prime flower
#

Happy CircuitPython day ๐Ÿ˜ƒ

plucky flint
#

@marble hornet yes it is ๐Ÿ˜ƒ

#

Which means it should work anywhere Kivy does (i.e. on Windows, OSX, Linux, Android and iOS)

marble hornet
#

nice! i played around with kivy when i was first learning python. i forgot it works on phones. and now cp?

plucky flint
#

And if it can sync with the efforts already done in CircuitPython for the Choose Your Own Adventure blog post, then I think it's a very helpful tool for folks learning to code (familiarity across platforms etc...)

#

Nope... not on CP. That's a different display system

marble hornet
#

the woes of little ram

#

@prime flower I'll give the tag thing a shot

plucky flint
#

Quite... but I like fitting cool stuff into small spaces. No bloat etc... makes you concentrate on the essentials (expressed simply)

#

All feedback most welcome too..!

#

Right now it's just a sort of a hack / shim. Needs much more testing and user feedback for it to reach its potential

prime flower
#

@plucky flint Heya, checked out the project, looks sweeet. I'm going to play with it and maybe port to PyPortal if I have time...there's a mega pyportal on my desk rn ๐Ÿ˜ƒ

plucky flint
#

But Hypercard... that was a stroke of genius remembering that stuff. ๐Ÿ˜ƒ

#

Awesome

#

@prime flower please don't hesitate to shout if you have feedback or suggestions

prime flower
#

Oh I will!

#

Interesting use of Kivvy though, I looked at it when I did a very strange Capstone project in PyQT and was comparing frameworks

plucky flint
#

That's the spirit. I'd love for folks to be able to run the same (or very similar) code on all sorts of fun devices, with Python being the lingua franca

#

I've never used Kivy before now... my choice was simply down to the cross platform nature of it.

marble hornet
#

I've been looking at app framework to see how i can improve mine but have been unable to find documentation for writing hypercard apps, i;m curious about the object location specifiying. know here it is?

plucky flint
#

Mu is, of course, PyQT. But that only works on desktop systems.

stuck elbow
#

@plucky flint we were actually talking with Kasia after the EP workshops that most people don't really need a programming language, they need an environment that lets you make use of their computers, and we've given hypercard and excel as examples

plucky flint
#

@marble hornet not sure what you mean

stuck elbow
#

@plucky flint and then the next day you announced pypercard

plucky flint
#

@timber mango yes... that x 10000

#

Great minds think alike (or fools seldom differ). ๐Ÿ˜‰

stuck elbow
#

I suppose minecraft and MUDs work like that too

#

except less practical

plucky flint
#

Hahahaha... funny you should mention muds. I'm writing one at the moment (a cleaned up and enhanced version of the one I did for PyWeek) ๐Ÿ˜‰

stuck elbow
plucky flint
#

Also, Minecraft is digital lego. I've seen almost 100 kids reduced to stunned silence when a buddy (Martin O'Hanlon) demonstrated "how to build a house" and called the function 100s of times to instantly build a city. ๐Ÿ˜‰

#

I know of Bret Victor, but haven't looked into what he's been up to for perhaps 18 months or so

stuck elbow
#

this one is old

#

it's about augmenting physical making spaces

#

a debugger for the real world, if you will

plucky flint
#

Aha... OK. I really liked his talk he did when he role-played an engineer from the late 1960s

#

Oooh... that's cool

stuck elbow
#

yeah, that was great, so many hidden references

plucky flint
#

Does the debugger work on politicians..? We could do with such a thing over here in the UK. ๐Ÿ˜‰

stuck elbow
#

that's a solved problem

plucky flint
#

(The one thing all British people can agree upon right now, is that our politics is broken)

stuck elbow
#

see the debugging procedure for the layer 8 and 9 of the ISO/OSI

plucky flint
#

OK... so that ASCII art is rather funky

#

I'll take a look later... I have a meeting starting in 45 mins and I need to prep for it.

stuck elbow
#

I guess that's against the COC here, I will remove it

#

have fun

plucky flint
#

thanks... best wishes to Kasia too..!

stuck elbow
#

thank you

minor plume
#

@idle owl just watched your PyOhio keynote - OMG soooooo good! Iโ€™ve been coding for a long time, and the imposter syndrome still resonates so strongly for me that I cried while I watched it. THANK YOU for being so open and real about your experiences! Sharing the video with a couple women Iโ€™m mentoring.

idle owl
#

@minor plume You're welcome! Thank you so much for sharing your experience! So glad to hear your mentoring. Thank you for sharing the keynote with others!

minor plume
#

@idle owl I was invited to be part of a panel discussion about imposter syndrome a few months ago. The day of the panel, my brain weasels were saying โ€œreally, what do YOU have to say about imposter syndrome? Who do you think you are?!?โ€ ๐Ÿ˜‚๐Ÿ˜ข

#

Brains are ridiculous sometimes.

idle owl
#

@minor plume They are ridiculous sometimes, indeed. I understand entirely.

manic glacierBOT
prime flower
#

@marble hornet Let me know how it goes, I'll (or you can) refresh the travis build on the PR and check it out

manic glacierBOT
river quest
zealous barn
#

Does anyone know of an example of sending I2C data inside of board_init()? I'd like my boards firmware image to configure an external I2C device before user CPY starts executing, but so far have only gotten to the stage of a compiled UF2 which immediately crashes.

marble hornet
#

@prime flower tagged it on master but am not sure if that will filter down to the sub? I'm on my phone but am more than willing to help later tonight

#

Although: if you don't mind refreshing it please do

manic glacierBOT
#

This keyboard test (and other programs) have run on my PIRKEY_M0 for a long time and also work under CP 4.1.0 but now fail under CP 5.0
Is there a known change needed?
I realize the PIRKEY is not really supported, but I suspect this an issue with HID support in general.

# Simple NEC remote decode-and-type keyboard example
# When used with the Adafruit NEC remote will act like a keyboard and
# type out keypresses.

import adafruit_irremote
from adafruit_hid.keyboard import Ke...
prime flower
#

@marble hornet Refreshed, the issue persists

marble hornet
#

I can't use a terminal on an iPhone but I could share editing access...

#

If that helps for diagnosis

manic glacierBOT
pastel panther
#

hiya <@&356864093652516868> CircuitPython Day stream is under the way on YouTube and Twitch. check #live-broadcast-chat for details and to hang with the rest of the audience!

river quest
ruby lake
#

lol that demo, it makes a squawk when it starts. Do you know what that does to someone who has seen lots of things explode on the bench? ๐Ÿ˜‰

exotic pumice
#

@slender iron How serious were you about rust modules in circuitpython? It intrigues me. Is there something simple I can try to build functionality wise so I can try out the logistics?

onyx hinge
onyx hinge
#

The good news is, he loved it and got to take the CPX home. The bad news is, I can't find my other CPX now ๐Ÿ˜ฆ ๐Ÿ˜ฆ

cerulean sparrow
#

I have made some tweaks to circuit python (really just a small pet pev), and have a merge request ready to go for circuit python. Is there any check list of things I should check before I submit?

onyx hinge
#

@cerulean sparrow just my personal checklist: basic adherence to the style of circuitpython code, and depend on the "travis" checks after your push for finding out whether there are problems with the build..

#

If changes are required, we will work with you on what they are, and you'll have a better idea for next time

#

@cerulean sparrow thanks for taking the time to make CircuitPython better!

cerulean sparrow
#

Is there any documentation on the travis checks? I have no experience with it.

onyx hinge
#

@cerulean sparrow basically, travis will build every board and do a few other checks. Within your pull request, it will later say whether travis thought things were OK or not, and if not you can go look at its logs and (with help) interpret what changes are necessary.

cerulean sparrow
#

Does github do that? or do I need to run that?

onyx hinge
#

so, for instance, I made some changes to audio recently, and travis caught that it adversely affected boards with no audio support at all

#

it happens automatically. Once you've submitted your pull request, it will appear in a section about "checks".

manic glacierBOT
manic glacierBOT
onyx hinge
#

@cerulean sparrow if you have some comparison images you can attach those on github or share them here, so we can get a better idea of the improvement your change makes. I guess you chose perlin noise because it doesn't have any excess RAM usage, vs traditional dithers like floyd-steinberg which requires at least one row of pixels extra?

cerulean sparrow
#

Will common_hal_displayio_ondiskbitmap_get_pixel be called on every pixel in order as well, or could there be cases where calls would be done out of order and/or clipped?

silver tapir
#

Just to comment, the PyBadger library is so much better than doing it by hand like in the other tutorial.

#

I'll be wearing mine in an exclusive science and tech conference next weekend. (CONCITES in Limon, Costa Rica, in case someone is around)

#

And to celebrate CircuitPython day (still is in my timezone), I'll be talking a little bit about it in the conference, and it's advantages in the field.

manic glacierBOT
manic glacierBOT
#

Hello again. I can't stress enough, if you would like help implementing any of these suggestions, we want to give you that help here or on the circuitpython discord.

First off, the thing where there are two "Travis CI - Pull Request" is a bit weird, pay attention to the failed one, not the one that still says "Queued - Build Created" 8 hours later. Travis is great, but sometimes things go a little weird.

There are some travis failures, here's a typical one:

Build metro_m0_expres...
idle owl
#

@silver tapir That's great to hear! Thanks for letting us know!

wraith tiger
#

I'm now trying to learn about writing vim plugins in python (something that's been on my mental todo list for a while) with the intention of creating a plugin to simplify working with the microbit from within vim.

marble hornet
#

@tulip sleet i think i figured out how:```class pho_module():

def __init__(self, file_path):
    d = {}
    exec(open(file_path, 'r').read(), d)
    for key in d:
        if type(key) == str:
            setattr(self, key, d[key])
    del d, file_path

namespace = pho_module('smoopsy.py')
print(dir(namespace))```

#

once i clean up the html colors i'll formalize this and a few other things and make a tools module

manic glacierBOT
manic glacierBOT
#

I've looked at this more closely and am worried it won't work for any arbitrary area. I looked at your Python library on top and it's going row by row to output to a bitmap.

Let's embrace that specific scenario and reduce the api down to fill_row where it's given a y and an array of 16bit values that is width long. Also check that the display has a 16 bit colorspace and raise an exception otherwise.

The rows_per_buffer section can all be simplified away because we're only doing one ro...

cursive sigil
#

<@&356864093652516868> this looks a lot an airlifted metro, any chance circuitpython runs on this? https://store.arduino.cc/usa/nano-33-iot

turbid radish
#

No

#

Not at the moment, perhaps theyd like to make a definition?

raven canopy
#

it might technically be possible. SAMD21, with NINAfied ESP32 over SPI. but, it has no external flash, so it would be severely limited on usefulness.

cursive sigil
#

Thanks. Interesting. I missed the missing flash

raven canopy
#

if you have a Trinket M0 and the AirLift breakout handy, that would be an equivalent to test viability.

#

looks at desk, sees both. ponders the effects of further task saturation. ๐Ÿ˜†

cursive sigil
#

:-p

tough flax
#

Well, @raven canopy while you're consdering that... ๐Ÿ˜ƒ

#

I have a "guidance question" for the group

#

We have a device based on a Trinket M0 (no, I cannot retarget to a SAMD51 - I wish I could)

#

We would like the ability for users to edit a config file on the device. Right now, I have a parser for "INI Style" files included in the code

#

It works.... until it runs out of memory

#

So if they go beyond basic configurations, it fails and it doesn't fail "pretty". It failed randomly as the GC chooses to run

#

SO.....

#

We have a couple options:

#
  1. Switch to Arduino & use TinyUSB to read the config file. This is pretty bleeding edge, but should solve the memory issue.
#
  1. Switch to a method of config file that doesn't require us to parse so many strings (which is where I think the issue is).
#

The code just looks for combinations of switch presses (long presses, too) and sends keystrokes & mouse movements.

#

I am thinking that I will try #2 first (I like the idea that end users could edit their own devices using the devices). I'm thinking about using Python as the "config language"...but it's not easy to think though how to do that.

#

Any guidance/thoughts would be appreciated.

#

thanks

raven canopy
#

@tough flax there is some space to be had in SettingsParser.read(). a quick "trimming" looked like this on a feather m0:

>>> gc.collect()
>>> gc.mem_free()
20528
>>> lines = ["[common]", "1 SPACE", "2 ENTER", ";foo"]
>>> for line in lines:
...     parts = line.split(";", 1)
...     value = str(parts[0]).strip()
...     if (value == ""):
...         continue
...     if (value[0] == "[" and value[-1] == "]"):
...         modeName = value[1:-1]
... 
>>> gc.mem_free()
19152

trimmed:

>>> gc.collect()
>>> gc.mem_free()
20528
>>> lines = ["[common]", "1 SPACE", "2 ENTER", ";foo"]
>>> for line in lines:
...     if line.split(";", 1)[0].strip():
...         if (line.startswith("[") and line.endswith("]")):
...             modeName = line.strip("[]")
... 
>>> gc.mem_free()
19328
#

and to show that it still works:

>>> for line in lines:
...     if line.split(";", 1)[0].strip():
...         if (line.startswith("[") and line.endswith("]")):
...             print("original:", line)
...             print("stripped:", line.strip("[]"))
... 
original: [common]
stripped: common
#

trimmed version isn't as readable and Pythonic, but desperate times... ๐Ÿ˜‰

tough flax
#

Yeah, we can probably shave off 1K or so. I think we're still in a place where the split(), strip() etc are allocating strings everywhere

#

And you're GC'ing... we can do that after the load I suppose, but with fragmentation, I'd rather never allocate those

raven canopy
#

could be. i almost compared to regex, but trinket doesn't have it.

tough flax
#

Yeah, I thought about JSON, but there's no room

raven canopy
#

TOML isn't any better vice INI either. ๐Ÿ˜ฆ

tough flax
#

I think putting it in Python's probably the right answer... but how do you make a Python imported file easy to edit?

#

I mean for a non-programmer to change w/o blowing things up

raven canopy
#

just make it a dict (key-pair) and exec/eval it?

tough flax
#

I thought that import was significantly better than eval... am I wrong on that?

#

Eval lets us add boilerplate at the start & end which might help