Complete Guide to Object-Oriented Programming in Python 🐍

Complete Guide to Object-Oriented Programming in Python 🐍

Complete Guide to Object-Oriented Programming in Python 🐍 Understand class, def, and self from scratch 📖 Introduction Have you encountered these confusions while learning Python: <span>What is the difference between class and def?</span> <span>What exactly is self? Why do we need to write it?</span> <span>What is the purpose of if __name__ == "__main__"?</span> 1️⃣ Basic … Read more

Understanding the C Language ‘inline’ Keyword

Understanding the C Language 'inline' Keyword

1) <span>inline</span> What is it? Semantics: It suggests to the compiler that “this function can be expanded inline at the call site, saving the overhead of a function call (saving/restoring registers, jumping/returning, etc.).” Not a guarantee: It is merely a suggestion, and the compiler may choose not to adopt it (depending on optimization level, function … Read more

Various Uses of Return in C Language

Various Uses of Return in C Language

According to the understanding of beginners, the task of return is to return the corresponding parameter, which is further processed in the outer function. In fact, the usage of return is not limited to this. Returning parameter values from the called function This type of application is the most common, usually in a function with … Read more

PLC Programming: Why FB Requires DB While FC Does Not?

PLC Programming: Why FB Requires DB While FC Does Not?

In PLC programming, FB (Function Block) and FC (Function) are two commonly used programming elements. Their design purposes and data processing methods differ, which directly leads to FB requiring a DB (Data Block) while FC does not. Why does FB require DB? The static variables and input/output parameters of FB need to be persistently stored … Read more

How to Return Two or More Values from a Function in C Language

How to Return Two or More Values from a Function in C Language

Multiple return valuesIn C language, a function can generally return only one value by default. So, how can we design a function to return two or more values?Example of a standard library functionBefore that, let’s recall a standard library function in C language that we previously introduced, ldiv(). This function can be used to perform … Read more

UVC Development on Sigmastar PureLinux System: USB Serial via Virtual COM Port

UVC Development on Sigmastar PureLinux System: USB Serial via Virtual COM Port

CDC (Communication Device Class) Serial Class: ACM, OBEX, GSER Currently, only the ACM function is supported, occupying three EP, of which 2 are BULK (in/out), and one is INT (in) The BULK EP of the ACM function supports trimming packet size: driver/usb/gadget/function/f_acm.cacm_bindusb_ep_autoconfig acm_fs_in_desc.wMaxPacketSize = 64; acm_fs_out_desc.wMaxPacketSize = 64; After modification, the ACM function can select … Read more