Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. casascius
    C
    • Continue chat with casascius
    • Start new chat with casascius
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    casascius

    @casascius

    0
    Reputation
    2
    Posts
    130
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    casascius Follow

    Posts made by casascius

    • RE: M5Paper won't execute loaded programs

      At a glance I would say commenting out noInterrupts() and interrupts() is the correct thing to do. Can anyone tell us why are they even there?

      The purpose of noInterrupts() is to prevent interrupt handlers from running in the middle of a critical section of code. But this makes no sense -- we are already in an interrupt handler here, where protection from other interrupts is already in effect until the function returns. At least that's the case for other Arduino microcontrollers -- admittedly, I haven't coded much for ESP32. Someone say something if I misunderstand this here.

      Furthermore, setting a byte size variable to a constant value like 1 isn't the sort of thing that counts as a critical section of code that would ever need noInterrupts() in the first place.

      I say it's safe to comment these two lines out and then I raise the question why were they ever there.

      posted in PRODUCTS
      C
      casascius
    • RE: M5Paper Shutdown() / Deep Sleep / Wakeup

      I'm coming in a bit late, but fought with this a little bit.

      For me, shutdown() wouldn't wake up at all. The ultimate cause was that the i2c bus wasn't getting properly initialized (another issue for another post -- touchpanel related) so the command to the clock chip was never getting sent.

      Once it got sent, doing a shutdown(10) to wake up after 10 seconds worked properly for me... in fact, so properly, you couldn't turn the device off because the alarm persists until deactivated. shutdown(-1) in setup() (after initializing i2c) is necessary to clear the timer alarm upon sketch restart (which I determined by inspecting the library source).

      Also by inspecting the source and datasheet, overload 4 that Jop says isn't working, I am guessing is because he only advanced the day of month. It looks as though the clock chip compares not just hour/minute/day, but also the day of week (e.g. Thursday) and, reviewing the source code, it doesn't ever consider the month or year at all, nor does the chip even have registers to alarm on these. But it has one for the weekday, so if you don't advance the weekday, the comparison will fail per the datasheet.

      posted in Cores
      C
      casascius