Git Product home page Git Product logo

Comments (4)

benblazak avatar benblazak commented on June 20, 2024

Please see the readme and maybe issue #19

from ergodox-firmware.

khlkh avatar khlkh commented on June 20, 2024

Finally, got it work on my machine.

*** ergodox-firmware/build-scripts/gen-ui-info.py 2013-08-19 22:00:14.320530087 +0800
--- new/ergodox-firmware/build-scripts/gen-ui-info.py 2013-08-19 21:57:45.307586030 +0800


*** 168,183 ****
length = int( search.group(2), 16 )

    search = re.search(r'0x\S+\s+(\S+)', next(f))

! name = search.group(1)

! return {
! 'keyboard-functions': {
! name: {
! 'position': position,
! 'length': length,
},
! },
! }

def parse_layout_matrices(f, line):
    """Parse layout matrix information in the '.map' file"""

--- 168,184 ----
length = int( search.group(2), 16 )

    search = re.search(r'0x\S+\s+(\S+)', next(f))

! if search:
! name = search.group(1)

! return {
! 'keyboard-functions': {
! name: {
! 'position': position,
! 'length': length,
! },
},
! }

def parse_layout_matrices(f, line):
    """Parse layout matrix information in the '.map' file"""

*** 352,358 ****
def parse_layout_file(layout_file_path):
match = re.findall( # find each whole 'kb_layout' matrix definition
r'(kb_layout\w)[^=]=((?:[^{}]{){3}[^=](?:[^{}]}){3})',
! subprocess.getoutput("gcc -E '"+layout_file_path+"'") )

    layout = {}
    # collect all the values

--- 353,359 ----
def parse_layout_file(layout_file_path):
match = re.findall( # find each whole 'kb_layout' matrix definition
r'(kb_layout\w)[^=]=((?:[^{}]{){3}[^=](?:[^{}]}){3})',
! subprocess.getoutput("avr-gcc -D KEYBOARD__ERGODOX__LAYOUT_h -E '"+layout_file_path+"'") )

    layout = {}
    # collect all the values

from ergodox-firmware.

khlkh avatar khlkh commented on June 20, 2024

Hi Ben Blazak

Thanks for the pointer. With some changes, the layout is generated.
diff -c ergodox-firmware/build-scripts/gen-ui-info.py new/ergodox-firmware/build-scripts/gen-ui-info.py
*** ergodox-firmware/build-scripts/gen-ui-info.py    2013-08-19 22:00:14.320530087 +0800
--- new/ergodox-firmware/build-scripts/gen-ui-info.py    2013-08-19 21:57:45.307586030 +0800


*** 168,183 ****
          length = int( search.group(2), 16 )
 
          search = re.search(r'0x\S+\s+(\S+)', next(f))
!         name = search.group(1)
 
!         return {
!             'keyboard-functions': {
!                 name: {
!                     'position': position,
!                     'length': length,
                  },
!             },
!         }
 
      def parse_layout_matrices(f, line):
          """Parse layout matrix information in the '.map' file"""
--- 168,184 ----
          length = int( search.group(2), 16 )
 
          search = re.search(r'0x\S+\s+(\S+)', next(f))
!         if search:
!             name = search.group(1)
 
!             return {
!                 'keyboard-functions': {
!                     name: {
!                         'position': position,
!                         'length': length,
!                     },
                  },
!             }
 
      def parse_layout_matrices(f, line):
          """Parse layout matrix information in the '.map' file"""


*** 352,358 ****
      def parse_layout_file(layout_file_path):
          match = re.findall(  # find each whole 'kb_layout' matrix definition
                  r'(kb_layout\w)[^=]=((?:[^{}]{){3}[^=](?:[^{}]}){3})',
!                 subprocess.getoutput("gcc -E '"+layout_file_path+"'") )
 
          layout = {}
          # collect all the values
--- 353,359 ----
      def parse_layout_file(layout_file_path):
          match = re.findall(  # find each whole 'kb_layout' matrix definition
                  r'(kb_layout\w)[^=]=((?:[^{}]{){3}[^=](?:[^{}]}){3})',
!                 subprocess.getoutput("avr-gcc -D KEYBOARD__ERGODOX__LAYOUT_h -E '"+layout_file_path+"'") )
 
          layout = {}
          # collect all the values


$ avr-gcc -v
Using built-in specs.
COLLECT_GCC=avr-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/avr/4.7.2/lto-wrapper
Target: avr
Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --bindir=/usr/bin --libexecdir=/usr/lib --libdir=/usr/lib --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-libssp --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=avr
Thread model: single
gcc version 4.7.2 (GCC)

/khl


From: Ben Blazak [email protected]
To: benblazak/ergodox-firmware [email protected]
Cc: khlkh [email protected]
Sent: Monday, August 19, 2013 5:28 AM
Subject: Re: [ergodox-firmware] Failed to generate json and keymap (#30)

Please see the readme and maybe issue #19

Reply to this email directly or view it on GitHub.

from ergodox-firmware.

benblazak avatar benblazak commented on June 20, 2024

Glad you got it working :)

from ergodox-firmware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.