Giter Site home page Giter Site logo

Comments (6)

GorgonMeducer avatar GorgonMeducer commented on July 28, 2024 1

The key example code is :

static uint8_t s_chQueueBuffer[QUEUE_BUFFER_SIZE];
enhanced_byte_queue_t *ptQueue = __new_class( enhanced_byte_queue,
s_chQueueBuffer,
sizeof(s_chQueueBuffer));
//! you can enqueue
ENHANCED_BYTE_QUEUE.Enqueue(ptQueue, 'p');
ENHANCED_BYTE_QUEUE.Enqueue(ptQueue, 'L');
ENHANCED_BYTE_QUEUE.Enqueue(ptQueue, 'O');
ENHANCED_BYTE_QUEUE.Enqueue(ptQueue, 'O');
ENHANCED_BYTE_QUEUE.Enqueue(ptQueue, 'C');
ENHANCED_BYTE_QUEUE.use_as__i_byte_queue_t.Enqueue(&ptQueue->use_as__byte_queue_t, '.');
ENHANCED_BYTE_QUEUE.use_as__i_byte_queue_t.Enqueue(&ptQueue->use_as__byte_queue_t, '.');
ENHANCED_BYTE_QUEUE.use_as__i_byte_queue_t.Enqueue(&ptQueue->use_as__byte_queue_t, '.');
//! you can dequeue
do {
uint_fast16_t n = ENHANCED_BYTE_QUEUE.Count(ptQueue);
uint8_t chByte;
printf("There are %d byte in the queue!\r\n", n);
printf("let's peek!\r\n");
while(ENHANCED_BYTE_QUEUE.Peek.PeekByte(ptQueue, &chByte)) {
printf("%c\r\n", chByte);
}
printf("There are %d byte(s) in the queue!\r\n",
ENHANCED_BYTE_QUEUE.Count(ptQueue));
printf("Let's remove all peeked byte(s) from queue... \r\n");
ENHANCED_BYTE_QUEUE.Peek.GetAllPeeked(ptQueue);
printf("Now there are %d byte(s) in the queue!\r\n",
ENHANCED_BYTE_QUEUE.Count(ptQueue));
} while(0);
__free_class(enhanced_byte_queue, ptQueue);

It is used to demonstrate the two example class byte_queue_t and enhanced_byte_queue_t .

You can create an simple "hello world" project and add the two classes into compilation.
During this process, if you encountered any issues, please feel free to let me know.

from plooc.

GorgonMeducer avatar GorgonMeducer commented on July 28, 2024

Did you find the MDK project file?

from plooc.

 avatar commented on July 28, 2024

Did you find the MDK project file?

What is MDK project file? I don't find anything other than C source file on https://github.com/GorgonMeducer/PLOOC/tree/master/example/byte_queue

from plooc.

GorgonMeducer avatar GorgonMeducer commented on July 28, 2024

image

Here is a project folder. Inside the folder, you can find the main.c and an MDK project.

@tn1997tn
About MDK, See here: https://www2.keil.com/mdk5/
You can apply a Community License from here: https://www.keil.com/pr/article/1299.htm

from plooc.

 avatar commented on July 28, 2024

@GorgonMeducer So PLOOC is for embedded development only? I don't do embedded development. I'm only finding an OOP framework for plain C. My development environment is Windows x86_64 with MSYS2 MINGW64. Github suggested your project to me when I was searching.

p/s: I found the MDK project files but I think I have no uses for them.

from plooc.

GorgonMeducer avatar GorgonMeducer commented on July 28, 2024

No, PLOOC isn't specifically designed for embedded. I only provide embedded projects just because it is convenient for me.

You should be able to use PLOOC with GCC / LLVM etc.

byte_queue.c is only an example of a class, that doesn't contains a main function. The error info is also telling you that you need an entry, i.e. WinMain()

undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status

from plooc.

Related Issues (12)

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.