aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/debounce
Commit message (Expand)AuthorAgeFilesLines
* quantum/debounce: rename debouncing algorithms (#9564)Purdea Andrei2020-09-065-28/+0
* quantum/debounce: Added sym_pk debounce algorithm (#8587)Purdea Andrei2020-04-112-7/+112
* format code according to conventions [skip ci]QMK Bot2020-04-112-10/+10
* Various fixes to how timer differences are calculated (#8585)Purdea Andrei2020-04-112-2/+22
* clang-format changesskullY2019-08-303-111/+106
* Fix debouncing issue for eager algorithms (#6081)Drashna Jaelre2019-07-092-11/+22
* [core] Fix for eager_pr #5643Alex Ong2019-04-181-1/+2
* Eager pk/pr optimization (#5621)Alex Ong2019-04-152-91/+72
* Eager Per Row Debouncing added (added to Ergodox) (#5498)Alex Ong2019-04-032-1/+101
* Clean up debounce a bit (#5255)James Churchill2019-03-043-9/+9
* Fix compile error in debounce_eager_pkalex-ong2019-01-271-2/+2
* Merge branch 'debounce_refactor' of https://github.com/alex-ong/qmk_firmware ...alex-ong2019-01-261-3/+3
|\
| * Fixed compilation error with debounce_sym_gAlex Ong2019-01-261-2/+2
| * Bug fix - was using MATRIX_ROWS instead of num_rowsAlex Ong2019-01-261-1/+1
* | Malloc array in debounce_eager_pk, since split keyboards only use MATRIX_ROWS/2.alex-ong2019-01-261-2/+5
|/
* Moved debouncing_time variable to inside #if debouncealex-ong2019-01-261-3/+2
* Working eager_pkalex-ong2019-01-261-23/+18
* DO NOT USE Revert back to original API to support split_keyboards.alex-ong2019-01-261-4/+4
* DO NOT USE - debounce successfully compiled.alex-ong2019-01-263-0/+209
: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/env python

import sys
import re
import string

from xenctl import vdisk

def usage():

    print >>sys.stderr,"""
Usage: %s command <params>

  initialise [dev] [[ext_size]] - init. a physcial partition to store vd's
  create [size] [[expiry]]      - allocate a vd of specified size (and expiry)
  enlarge [vdid] [extra_size]   - enlarge a specified vd by some amount
  delete [vdid]                 - delete a vd
  import [filename] [[expiry]]  - create a vd and populate w/ image from file
  export [vdid] [filename]      - copy vd's contents to a file
  setexpiry [vdid] [[expiry]]   - update the expiry time for a vd
  list                          - list all the unexpired virtual disks  
  undelete [vdid] [[expiry]]    - attempts to recover an expired vd
  freespace                     - print out the amount of space in free pool

notes:
  vdid      - the virtual disk's identity string
  size      - measured in MB
  expiry    - is the expiry time of the virtual disk in seconds from now
               (0 = don't expire) 
  device    - physical partition to 'format' to hold vd's. e.g. hda4
  ext_size  - extent size (default 64MB)
""" % sys.argv[0]  

if len(sys.argv) < 2: 
    usage()
    sys.exit(-1)

rc=''
src=''
expiry_time = 0
cmd = sys.argv[1]

if cmd == 'initialise':

    dev = sys.argv[2]

    if len(sys.argv) > 3:
	extent_size = int(sys.argv[3])
    else:
	print """No extent size specified - using default size of 64MB"""
	extent_size = 64

    print "Formatting for virtual disks"
    print "Device: " + dev
    print "Extent size: " + str(extent_size) + "MB"

    rc = vdisk.vd_format(dev, extent_size)

elif cmd == 'create':
 
    size = int(sys.argv[2])
    
    if len(sys.argv) > 3:
	expiry_time = int(sys.argv[3])

    print "Creating a virtual disk"
    print "Size: %d" % size
    print "Expiry time (seconds from now): %d" % expiry_time

    src = vdisk.vd_create(size, expiry_time)

elif cmd == 'enlarge':

    id = sys.argv[2]

    extra_size = int(sys.argv[3])

    rc = vdisk.vd_enlarge(id, extra_size)

elif cmd == 'delete':

    id = sys.argv[2]

    print "Deleting a virtual disk with ID: " + id

    rc = vdisk.vd_delete(id)

elif cmd == 'import':

    file = sys.argv[2]
    
    if len(sys.argv) > 3:
	expiry_time = int(sys.argv[3])

    print "Allocate new virtual disk and populate from file : %s" % file

    print vdisk.vd_read_from_file(file, expiry_time)

elif cmd == 'export':

    id = sys.argv[2]
    file = sys.argv[3]

    print "Dump contents of virtual disk to file : %s" % file

    rc = vdisk.vd_cp_to_file(id, file )

elif cmd == 'setexpiry':

    id = sys.argv[2]

    if len(sys.argv) > 3:
	expiry_time = int(sys.argv[3])

    print "Refreshing a virtual disk"
    print "Id: " + id
    print "Expiry time (seconds from now [or 0]): " + str(expiry_time)

    rc = vdisk.vd_refresh(id, expiry_time)

elif cmd == 'list':
    print 'ID    Size(MB)      Expiry'

    for vbd in vdisk.vd_list():
        vbd['size_mb'] = vbd['size'] / vdisk.VBD_SECTORS_PER_MB
        vbd['expiry'] = (vbd['expires'] and vbd['expiry_time']) or 'never'
        print '%(vdisk_id)-4s  %(size_mb)-12d  %(expiry)s' % vbd

elif cmd == 'freespace':

    print vdisk.vd_freespace()

elif cmd == 'undelete':

    id = sys.argv[2]

    if len(sys.argv) > 3:
	expiry_time = int(sys.argv[3])
   
    if vdisk.vd_undelete(id, expiry_time):
	print "Undelete operation failed for virtual disk: " + id
    else:
	print "Undelete operation succeeded for virtual disk: " + id

else:
    usage()
    sys.exit(-1)


if src != '':  
    print "Returned virtual disk id is : %s" % src

if rc != '':
    print "return code %d" % rc