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

Sweep: Add support for M5Stack Cardputer #4

Open
3 tasks done
vs4vijay opened this issue Apr 21, 2024 · 1 comment · May be fixed by #5
Open
3 tasks done

Sweep: Add support for M5Stack Cardputer #4

vs4vijay opened this issue Apr 21, 2024 · 1 comment · May be fixed by #5
Labels
sweep Sweep your software chores

Comments

@vs4vijay
Copy link
Owner

vs4vijay commented Apr 21, 2024

Add support for M5Stack Cardputer as follows:

Create a file named doomgeneric_m5card.c and implement following functions as per M5Stack's libraries like M5Cardputer, M5Unified, M5GFX, etc:

Functions Description
DG_Init Initialize your platfrom (create window, framebuffer, etc...).
DG_DrawFrame Frame is ready in DG_ScreenBuffer. Copy it to your platform's screen.
DG_SleepMs Sleep in milliseconds.
DG_GetTicksMs The ticks passed since launch in milliseconds.
DG_GetKey Provide keyboard events.
Checklist
@sweep-ai sweep-ai bot added the sweep Sweep your software chores label Apr 21, 2024
Copy link

sweep-ai bot commented Apr 21, 2024

🚀 Here's the PR! #5

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: f65aba5a18)
Install Sweep Configs: Pull Request

Tip

I can email you next time I complete a pull request if you set up your email here!


Actions (click)

  • ↻ Restart Sweep

Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description.

https://github.com/vs4vijay/doomgeneric/blob/613f870b6fa83ede448a247de5a2571092fa729d/doomgeneric/Makefile#L1-L53


Step 2: ⌨️ Coding

  • Create doomgeneric/doomgeneric_m5card.cc74f80c Edit
Create doomgeneric/doomgeneric_m5card.c with contents: 1. Add the necessary includes for M5Stack libraries: #include #include #include
  1. Implement the DG_Init() function:
    void DG_Init() {
    M5.begin();
    // Initialize M5Stack Cardputer
    }

  2. Implement the DG_DrawFrame() function:
    void DG_DrawFrame() {
    // Copy DG_ScreenBuffer to M5Stack screen buffer
    // Call M5.Lcd.drawBitmap() or similar
    M5.Lcd.drawBitmap(...);
    }

  3. Implement the DG_SleepMs() function:
    void DG_SleepMs(uint32_t ms) {
    delay(ms);
    }

  4. Implement the DG_GetTicksMs() function:
    uint32_t DG_GetTicksMs() {
    return millis();
    }

  5. Implement the DG_GetKey() function:
    int DG_GetKey(int* pressed, unsigned char* key) {
    // Read key state from M5Stack buttons
    // Set *pressed and *key appropriately
    // Return 1 if a key was read, 0 if not
    }

Modify doomgeneric/Makefile with contents: In the SRC_DOOM variable definition, add "doomgeneric_m5card.o" to the end of the list to compile the new file.
Modify doomgeneric/Makefile with contents: In the LIBS variable definition, add the required M5Stack library flags like "-lM5Cardputer -lM5Unified -lM5GFX" to link against those libraries.

Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/add_support_for_m5stack_cardputer.


🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description.
Something wrong? Let us know.

This is an automated message generated by Sweep AI.

@sweep-ai sweep-ai bot linked a pull request Apr 21, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Sweep your software chores
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant