Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kitronik :GAME ZIP64 & :GAME Controller Extensions do not work in V3 MakeCode #3532

Closed
AlasdairAtKitronik opened this issue Oct 30, 2020 · 11 comments

Comments

@AlasdairAtKitronik
Copy link

Describe the bug
The button press blocks in both extensions (https://github.com/KitronikLtd/pxt-kitronik-zip-64 & https://github.com/KitronikLtd/pxt-kitronik-game-controller) cause a compilation error.

To Reproduce
Steps to reproduce the behavior:

  1. Go to MakeCode beta editor and start a new project.
  2. Add in either the :GAME ZIP64 or :GAME Controller extension.
  3. Create a program with one of the button press blocks, e.g.:
    image
  4. Attempt to download the program and see the error message:
    image

Expected behavior
The program should be able to download (was working fine in MakeCode V2) and be used to program a micro:bit, then pressing the Joypad Up button should display a smiling face on the micro:bit.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 86.0.4240.111 (Official Build) (64-bit)

Additional context
Both of these extensions make use of a C++ file to create new button press events:

namespace Kitronik_Game_Controller {

    bool initialized = false;

    //%
    void init() {
        if (initialized) return;
        //This function sets all the buttons on the :GAME Controller to actually appear as buttons on the micro:bit
        #define ALLOC_PIN_BUTTON(id) new MicroBitButton(getPin(id)->name, id, MICROBIT_BUTTON_ALL_EVENTS, PullUp);
            ALLOC_PIN_BUTTON(MICROBIT_ID_IO_P8)
            ALLOC_PIN_BUTTON(MICROBIT_ID_IO_P12)
            ALLOC_PIN_BUTTON(MICROBIT_ID_IO_P13)
            ALLOC_PIN_BUTTON(MICROBIT_ID_IO_P14)
            ALLOC_PIN_BUTTON(MICROBIT_ID_IO_P15)
            ALLOC_PIN_BUTTON(MICROBIT_ID_IO_P16)
        #undef ALLOC_PIN_BUTTON

        initialized = true;
    }
}

The buttons and button press events are then implemented in the TypeScript file:

/**
    *:GAME Controller Button Pins
    */
    export enum ControllerButtonPins {
        //% block="Joypad Up (P8)"
        Up = DAL.MICROBIT_ID_IO_P8,
        //% block="Joypad Down (P14)"
        Down = DAL.MICROBIT_ID_IO_P14,
        //% block="Joypad Left (P12)"
        Left = DAL.MICROBIT_ID_IO_P12,
        //% block="Joypad Right (P13)"
        Right = DAL.MICROBIT_ID_IO_P13,
        //% block="Fire 1 (P15)"
        Fire1 = DAL.MICROBIT_ID_IO_P15,
        //% block="Fire 2 (P16)"
        Fire2 = DAL.MICROBIT_ID_IO_P16
    }

    /**
    *:GAME Controller Button Events
    */
    export enum ControllerButtonEvents {
        //% block="down"
        Down = DAL.MICROBIT_BUTTON_EVT_DOWN,
        //% block="up"
        Up = DAL.MICROBIT_BUTTON_EVT_UP,
        //% block="click"
        Click = DAL.MICROBIT_BUTTON_EVT_CLICK
    }
@abchatra
Copy link
Contributor

abchatra commented Nov 3, 2020

@AlasdairAtKitronik Is this in /beta?

@AlasdairAtKitronik
Copy link
Author

I have tried this in beta and V3.1 - broken for both extensions in both editors.

@AlasdairAtKitronik
Copy link
Author

@abchatra @jaustin Is there any update on what this issue could be?
I noticed this comment on #3506:

"Extensions using Button from mbed aren't compatible with CODAL button
There's an existing issue to add the constructor to CODAL, or it could be added as part of the compat layer
microbit-foundation/codal-microbit#142 (private repo)"

Is this linked to the button issue here?

@jaustin
Copy link
Collaborator

jaustin commented Nov 20, 2020

@abchatra there's something up with these extensions in that even though they're both in the "do not compile on V2" list, the compilation still hangs in the latest live editor release so they appear broken on V1. @mmoskal any ideas?
(for example KitronikLtd/pxt-kitronik-zip-64#2 (comment))

@AlasdairAtKitronik
Copy link
Author

@jaustin @abchatra It's the same for the ZIP Tile extension as well: KitronikLtd/pxt-kitronik-zip-tile#3

@mmoskal
Copy link
Member

mmoskal commented Nov 20, 2020

I think the compile service is down

@jaustin
Copy link
Collaborator

jaustin commented Nov 20, 2020

@mmoskal thanks - do you think it's still down? I'm still seeing an indefinite hang on this project, just tested again. (I also tested an older version of MakeCode and got the same problem)

@DaveAtKitronik
Copy link
Contributor

We are having reports in from users of our boards / extensions.
Any updates?

@jaustin
Copy link
Collaborator

jaustin commented Nov 25, 2020

@abchatra this looks compile service related at this point as this doesn't work for V1 boards even though that's just microbit-dal and the same code as always!

@abchatra
Copy link
Contributor

abchatra commented Feb 9, 2021

@DaveAtKitronik is this still an issue?

@DaveAtKitronik
Copy link
Contributor

Seems to be working, so I think not any more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants