Skip to content
Snippets Groups Projects
Select Git revision
  • b0e0988f0c2ba8bb5a048a88fa5c2ba47f75b310
  • master default protected
  • fix-warnings
  • tvbgone-fixes
  • genofire/ble-follow-py
  • schneider/ble-stability-new-phy-adv
  • schneider/ble-stability
  • msgctl/gfx_rle
  • schneider/ble-stability-new-phy
  • add_menu_vibration
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • schneider/fundamental-test
  • schneider/ble-buffers
  • schneider/maxim-sdk-update
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • v1.11
  • v1.10
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
36 results

meson.build

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    • rahix's avatar
      b79d1f62
      fix(build): Disable -Wchar-subscripts warnings · b79d1f62
      rahix authored
      
      Disable these warnings as they don't really help in our case:
      
          In file included from ../epicardium/modules/config.c:8:
          ../epicardium/modules/config.c: In function 'trim':
          ../epicardium/modules/config.c:133:28: warning: array subscript has type 'char' [-Wchar-subscripts]
            133 |  while (*start && !isgraph(*start))
                |                            ^~~~~~
          ../epicardium/modules/config.c:138:27: warning: array subscript has type 'char' [-Wchar-subscripts]
            138 |   while (*end && !isgraph(*end))
                |                           ^~~~
          ../epicardium/modules/config.c: In function 'epic_config_get_string':
          ../epicardium/modules/config.c:335:26: warning: array subscript has type 'char' [-Wchar-subscripts]
            335 |  while (*end && !iscntrl(*end))
                |                          ^~~~
          ../epicardium/modules/config.c: In function 'epic_config_set_string':
          ../epicardium/modules/config.c:519:28: warning: array subscript has type 'char' [-Wchar-subscripts]
            519 |   while (*end && (!iscntrl(*end) || isblank(*end)))
                |
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      b79d1f62
      History
      fix(build): Disable -Wchar-subscripts warnings
      rahix authored
      
      Disable these warnings as they don't really help in our case:
      
          In file included from ../epicardium/modules/config.c:8:
          ../epicardium/modules/config.c: In function 'trim':
          ../epicardium/modules/config.c:133:28: warning: array subscript has type 'char' [-Wchar-subscripts]
            133 |  while (*start && !isgraph(*start))
                |                            ^~~~~~
          ../epicardium/modules/config.c:138:27: warning: array subscript has type 'char' [-Wchar-subscripts]
            138 |   while (*end && !isgraph(*end))
                |                           ^~~~
          ../epicardium/modules/config.c: In function 'epic_config_get_string':
          ../epicardium/modules/config.c:335:26: warning: array subscript has type 'char' [-Wchar-subscripts]
            335 |  while (*end && !iscntrl(*end))
                |                          ^~~~
          ../epicardium/modules/config.c: In function 'epic_config_set_string':
          ../epicardium/modules/config.c:519:28: warning: array subscript has type 'char' [-Wchar-subscripts]
            519 |   while (*end && (!iscntrl(*end) || isblank(*end)))
                |
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
    datalogger.py 1.13 KiB
    # datalogger.py
    # Logs the data from the acceleromter to a file on the SD-card
    
    import pyb
    
    # creating objects
    accel = pyb.Accel()
    blue = pyb.LED(4)
    switch = pyb.Switch()
    
    # loop
    while True:
    
        # wait for interrupt
        # this reduces power consumption while waiting for switch press
        pyb.wfi()
    
        # start if switch is pressed
        if switch():
            pyb.delay(200)                      # delay avoids detection of multiple presses
            blue.on()                           # blue LED indicates file open
            log = open('1:/log.csv', 'w')       # open file on SD (SD: '1:/', flash: '0/)
    
            # until switch is pressed again
            while not switch():
                t = pyb.millis()                            # get time
                x, y, z = accel.filtered_xyz()              # get acceleration data
                log.write('{},{},{},{}\n'.format(t,x,y,z))  # write data to file
    
            # end after switch is pressed again
            log.close()                         # close file
            blue.off()                          # blue LED indicates file closed
            pyb.delay(200)                      # delay avoids detection of multiple presses