Author Topic: [QMK] JJ40 AUDIO_ENABLE (issue with TIMSK) Atmega32A  (Read 436 times)

0 Members and 1 Guest are viewing this topic.

Offline OhManIAmWorried

  • Thread Starter
  • Posts: 37
  • Location: Ukraine
[QMK] JJ40 AUDIO_ENABLE (issue with TIMSK) Atmega32A
« on: Thu, 10 September 2020, 07:09:04 »
Hi all,

I have been experiencing some problems with adding the audio capabilities to my JJ40.

Despite the AUDIO_ENABLE option being included in the default JJ40 rules.mk file, modifying this option doesn't seem to work.

First of all, the C6 pin is used in the keyboard matrix, according to the config.h file. This contradicts the comment left in rules.mk file "Audio output on port C6" after the aforementioned option, which makes me think that no thought was given about it, to begin with.

Secondly, when trying to build the firmware, the following error occurs:

More
make jj40:rp_v2
QMK Firmware 0.10.7
Making jj40 with keymap rp_v2

avr-gcc.exe (GCC) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Size before:
   text    data     bss     dec     hex filename
      0   19734       0   19734    4d16 .build/jj40_rp_v2.hex

Compiling: keyboards/jj40/keymaps/rp_v2/keymap.c                                                    [OK]
Compiling: quantum/audio/audio_avr.c                                                               quantum/audio/audio_avr.c: In function 'audio_init':
quantum/audio/audio_avr.c:82:41: error: 'TIMSK1' undeclared (first use in this function); did you mean 'TIMSK'?
 #    define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1A)
                                         ^~~~~~
quantum/audio/audio_avr.c:194:9: note: in expansion of macro 'DISABLE_AUDIO_COUNTER_1_ISR'
         DISABLE_AUDIO_COUNTER_1_ISR;
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
quantum/audio/audio_avr.c:82:41: note: each undeclared identifier is reported only once for each function it appears in
 #    define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1A)
                                         ^~~~~~
quantum/audio/audio_avr.c:194:9: note: in expansion of macro 'DISABLE_AUDIO_COUNTER_1_ISR'
         DISABLE_AUDIO_COUNTER_1_ISR;
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
quantum/audio/audio_avr.c: In function 'stop_all_notes':
quantum/audio/audio_avr.c:82:41: error: 'TIMSK1' undeclared (first use in this function); did you mean 'TIMSK'?
 #    define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1A)
                                         ^~~~~~
quantum/audio/audio_avr.c:250:5: note: in expansion of macro 'DISABLE_AUDIO_COUNTER_1_ISR'
     DISABLE_AUDIO_COUNTER_1_ISR;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
quantum/audio/audio_avr.c: In function 'stop_note':
quantum/audio/audio_avr.c:82:41: error: 'TIMSK1' undeclared (first use in this function); did you mean 'TIMSK'?
 #    define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1A)
                                         ^~~~~~
quantum/audio/audio_avr.c:297:13: note: in expansion of macro 'DISABLE_AUDIO_COUNTER_1_ISR'
             DISABLE_AUDIO_COUNTER_1_ISR;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
quantum/audio/audio_avr.c: In function '__vector_7':
quantum/audio/audio_avr.c:82:41: error: 'TIMSK1' undeclared (first use in this function); did you mean 'TIMSK'?
 #    define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1A)
                                         ^~~~~~
quantum/audio/audio_avr.c:612:21: note: in expansion of macro 'DISABLE_AUDIO_COUNTER_1_ISR'
                     DISABLE_AUDIO_COUNTER_1_ISR;
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
quantum/audio/audio_avr.c: In function 'play_note':
quantum/audio/audio_avr.c:82:41: error: 'TIMSK1' undeclared (first use in this function); did you mean 'TIMSK'?
 #    define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1A)
                                         ^~~~~~
quantum/audio/audio_avr.c:659:9: note: in expansion of macro 'DISABLE_AUDIO_COUNTER_1_ISR'
         DISABLE_AUDIO_COUNTER_1_ISR;
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
quantum/audio/audio_avr.c: In function 'play_notes':
quantum/audio/audio_avr.c:82:41: error: 'TIMSK1' undeclared (first use in this function); did you mean 'TIMSK'?
 #    define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1A)
                                         ^~~~~~
quantum/audio/audio_avr.c:703:9: note: in expansion of macro 'DISABLE_AUDIO_COUNTER_1_ISR'
         DISABLE_AUDIO_COUNTER_1_ISR;
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
 [ERRORS]
 |
 |
 |
make[1]: *** [tmk_core/rules.mk:386: .build/obj_jj40_rp_v2/quantum/audio/audio_avr.o] Ошибка 1
Make finished with errors
make: *** [Makefile:584: jj40:rp_v2] Error 1


I am not sure if TIMSK1/3 are available on atmega32a, since the documentation for this MCU discusses TIMSK as the only timer option. Is this the indication of incompatibility of this MCU with audio feature? Was someone more lucky at using Atmega32A or JJ40 in particular with this feature?

I hope you can share some thought on it. Thank you.
« Last Edit: Thu, 10 September 2020, 07:20:28 by OhManIAmWorried »
APC F-21 "Clicker" Drevo71 Delux M-618 DataComp dfk102

NTC 74% cut