Avatar for FransM


Member since Apr 2020 • Last active Oct 2020
  • 8 conversations

Most recent activity

  • in Bangle.js
    Avatar for FransM

    I can't help you with the inline C but if your string is null terminated you do not need the len variable at all. Just use

    while (*data)

    and the if statement could be avoided by writing

    s = s + (*(data++)=='\n');

    This exploits that the boolean expression returns 0 or 1.
    Whether this is faster is to be benchmarked as it will depend on compiler and how the code is actually compiled.

  • in Bangle.js
    Avatar for FransM

    I don't think NFC is supported in bangle. iirc the chip does support it, but the necessary additional hardware is missing.
    It is in the firmware as some other espruino devices have it.

  • in Bangle.js
    Avatar for FransM

    @fractalf The watch supports bluetooth LE, you can make a connection without going to the official app store.

    I'm not sure what you exactly want to do but all code is public.
    You can clone the app store on github and use your own modified copy.
    Or you could even run your own web server with a copy of the app store.

    But if you want more direct communcation between e.g. phone and watch that is also possible.
    In that case you might want to have a look at gadgetbridge but there are undoubtedly other apps that provide functionality like this.

  • in Bangle.js
    Avatar for FransM

    @Gordon Thanks for the patch to add wrapping.
    Unfortunately there is one issue with it. You cannot select 31 as a date.
    Here's a pull request to fix that: https://github.com/espruino/BangleApps/p­ull/490

    Actually it is possible to create invalid dates like Feb 30 or Jun 31 but I feel it is not really worth the effort to "fix" that. Introducing the number of days per month is easy but then come leap years, someone with a date like Jan 30, moving Jan to Feb (and 30 becomes invalid).
    My suggestion is not to bother about that.

    Edit: LOL you're quick, my pull request was already merged before I finished typing this message :-)

  • in Bangle.js
    Avatar for FransM

    @Humpelstilzchen I think gps time does this?

    @Gordon I can confirm that after a reboot I got the gps time again. Maybe it was due to the firmware upgrade that it lost the time.

    I did not install default apps or so after the firmware update. Will do so later today and report back.
    Meanwhile, I'm still curious whether my original suggestion is sound (and whether you want a pull request for it).

  • in Bangle.js
    Avatar for FransM

    @Humpelstilzchen I expect the configuration only to be done using min and max, as the code to set the minutes uses the same mechanism.

    Wrt gps time: that is nice, but does not work that well when you are inside and need a forced reboot.
    Wrt the app loader: great suggestion, I was unaware of that, thank you.

    @NebbishHacker I tried my changed settings on the phone by updating settings.js but that did not change things, not even after a reboot. It did not get stuck .
    I'm at the latest FW version (actually what was latest last Friday somewhere during the day).
    I'm indeed using the IDE, I was unaware of how to do that with apploader.js, thanks for the reference (and I did not really consider a local server but that is also definitely a possible path to pursue.

  • in Bangle.js
    Avatar for FransM

    I was a bit annoyed that when setting the time the hours did not wrap.
    So when going up it would stuck at 23 instead of wrapping to 0 and when going down it would be stuck at 0.

    I tried to change this by modifying the Hour section of showSetTimeMenu in settings.js to this:

    'Hour': {
          value: d.getHours(),
          min: -1,
          max: 24,
          step: 1,
          onchange: v => {
            d = new Date();
            setTime(d.getTime() / 1000);

    I thought that would to the trick but to no avail.
    I did overwrite settings.js on the bangle; that did not work, then I rebooted but still no luck.
    I've read back settings.js to verify that it is actually the modified version and it is.
    What am I doing wrong ???

  • in Bangle.js
    Avatar for FransM

    Probably the function was inlined because I was using gcc 9
    Performance impact is indeed minimal.

    If you want to get rid of spiFlashReadWrite you can merge this pull request

    Edit: just force-pushed an update to the branch as I forgot to add an entry in Changelog