aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/common/debug.c
diff options
context:
space:
mode:
authormarhalloweenvt <marhalloweenvt@gmail.com>2020-01-02 23:57:47 +0700
committerJames Young <18669334+noroadsleft@users.noreply.github.com>2020-01-02 08:57:47 -0800
commit53757f97059ce02a1af31aae456b168954f5232e (patch)
tree84189edeb1c6eb76ffb656357f7b7fd3c49d1b4f /tmk_core/common/debug.c
parent8ec0b378bc5cd0f0154e24c4a765f91b60791f2c (diff)
downloadfirmware-53757f97059ce02a1af31aae456b168954f5232e.tar.gz
firmware-53757f97059ce02a1af31aae456b168954f5232e.tar.bz2
firmware-53757f97059ce02a1af31aae456b168954f5232e.zip
[Keyboard] Add p65rgb PCB (#7753)
* [Keyboard] Add new keyboard Symmetry60 * Add new keyboard Symmetry60 * Fix Typo * Update keyboards/handwired/symmetry60/config.h * Update keyboards/handwired/symmetry60/readme.md * Update keyboards/handwired/symmetry60/readme.md * Update keyboards/handwired/symmetry60/readme.md * Update keyboards/handwired/symmetry60/rules.mk * Update keyboards/handwired/symmetry60/symmetry60.h * Update keyboards/handwired/symmetry60/symmetry60.h * Update keyboards/handwired/symmetry60/symmetry60.h * Update readme.md * Update keymap.c * Update keymap.c * Update keymap.c * Update rules.mk * Update symmetry60.c * Update keyboards/handwired/symmetry60/rules.mk * Add ColorLice * Update ColorLice - Adjust info.json to support Configurator - Adjust layout name to fit with info.json - Seperate 2 feature: RGB Switch and RGB Underglow * Update new way of control lock leds * Remove #ifndef COLORLICE_H * Update make example * Revert Helix * Revert Helix * Revert Helix * Revert Helix * Update keyboards/handwired/colorlice/colorlice.h * Update keyboards/handwired/colorlice/colorlice.h * Update default keymap * Revert Helix * Update keyboards/handwired/colorlice/readme.md * Update keyboards/handwired/colorlice/rules.mk * Update keyboards/handwired/colorlice/colorlice.c * Update keyboards/handwired/colorlice/colorlice.c * Remove unnecessary function * Update keyboards/handwired/colorlice/colorlice.c * Adjust rules option for working with Configurator - Move RGB_MATRIX_ENABLE and RGBLIGHT_ENABLE to keyboard rule. - Add RGB_DI_PIN in keyboard config * Update keyboards/helix/rev2/keymaps/default/keymap.c * Update keyboards/handwired/colorlice/readme.md * Update keymap for Colorlice * Adjust rules.mk to use space indent * Update ColorLice to work with QMK online configurator - Delete rgb_underglow keymap - Move config from keymap layer to keyboard layer - Tweak a little layout so it can appear default layout on QMK config * Update keyboards/handwired/colorlice/rules.mk * Update keyboards/handwired/colorlice/rules.mk * Add p65rgb * Update keyboards/handwired/p65rgb/config.h * Update p65rgb.c * Update keymap.c * Update rules.mk
Diffstat (limited to 'tmk_core/common/debug.c')
0 files changed, 0 insertions, 0 deletions
.gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: 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 */
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * Copyright (C) IBM Corp. 2005
 *
 * Authors: Jimi Xenidis <jimix@watson.ibm.com>
 */

#include <xen/config.h>
#include <xen/init.h>
#include <xen/lib.h>
#include <xen/ctype.h>
#include <xen/kernel.h>
#include "of-devtree.h"

void ofd_prop_print(
    const char *head,
    const char *path,
    const char *name,
    const char *prop,
    size_t sz)
{
#define DEBUG_PROP
#ifndef DEBUG_PROP
    if ( path[0] == '/' && path[1] == '\0' ) {
        path = "";
    }
    printk("%s: %s/%s: 0x%lx\n", head, path,  name, sz);
#else
    int i;
    int isstr = sz;
    const char *b = prop;

    for ( i = 0; i < sz; i++ ) {
        /* see if there is any non printable characters */
        if ( !isprint(b[i]) ) {
            /* not printable */
            if (b[i] != '\0' || (i + 1) != sz) {
                /* not the end of string */
                isstr = 0;
                break;
            }
        }
    }

    if ( isstr > 0 ) {
        printk("%s: \t%s\n", head, b);
    } else if ( sz != 0 ) {
        printk("%s: \t0x", head);

        for ( i = 0; i < sz; i++ ) {
            if ( (i % 4) == 0 && i != 0 ) {
                if ( (i % 16) == 0 && i != 0 ) {
                    printk("\n%s: \t0x", head);
                } else {
                    printk(" 0x");
                }
            }
            if (b[i] < 0x10) {
                printk("0");
            }
            printk("%x", b[i]);
        }
        printk("\n");
    }
#endif
}

void ofd_dump_props(void *mem, const char *pre, ofdn_t n, int dump)
{
    ofdn_t p;
    char name[128];
    char prop[256] __attribute__ ((aligned (__alignof__ (u64))));
    int sz;
    const char *path;

    if ( n == OFD_ROOT ) {
        path = "";
    } else {
        path = ofd_node_path(mem, n);
    }

    if (dump & OFD_DUMP_NAMES) {
        printk("%s: %s: phandle 0x%x\n", pre, path, n);
    }

    p = ofd_nextprop(mem, n, NULL, name);
    while ( p > 0 ) {
        sz = ofd_getprop(mem, n, name, prop, sizeof (prop));
        if ( sz > 0 && sz > sizeof (prop) ) {
            sz = sizeof (prop);
        }

        if ( dump & OFD_DUMP_VALUES ) {
            ofd_prop_print(pre, path, name, prop, sz);
        }

        p = ofd_nextprop(mem, n, name, name);
    }
}

void ofd_walk(void *m, const char *pre, ofdn_t p, walk_fn fn, int arg)
{
    ofdn_t n;

    if ( fn != NULL ) {
        (*fn)(m, pre, p, arg);
    }

    /* child */
    n = ofd_node_child(m, p);
    if ( n != 0 ) {
        ofd_walk(m, pre, n, fn, arg);
    }

    /* peer */
    n = ofd_node_peer(m, p);
    if ( n != 0 ) {
        ofd_walk(m, pre, n, fn, arg);
    }
}