FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Embedded software architecture design

     

    Module division The "plan" of the module is planned, meaning how to reasonably divide a large software into part of a series of functions to complete the needs of the system. The C language is a structured programming language. It is mainly based on the function (depending on functionality) on the division of the module (according to functionality), which is an error in object-oriented design. Newton's law encounters a relative difference). The C language modular program design needs to be understood concept: (1) The module is a .C file and a bind to one .h file, the header file (.h) is a statement for the module interface; (2) A module provides external functions and data to other modules to be called in. Hs in in files in the crown of Extern keywords; (3) The function and global variables in the module must be in the .C file start with Static keyword declaration; (4) Never define variables in .h file! The difference between definition variables and declaration variables is that the operation of the memory allocation is the concept of the assembly phase; and the declaration is just telling the module that contains the declaration to find external functions and variables from other modules in the connection phase. like: /*Module1.H*/ INT A = 5; / * Defines int A * / in the module 1. / * Module1 .c * / #include "module1.h" / * contains module 1 .h file * / / * Module2 .c * / #include "module1.h" / * contains module 1 in module 1. H file * / / * module3 .c * / #include "module1.h" / * contains the module 1 .h file * / The result of the above procedure is to define integer variables A in modules 1, 2, 3, which correspond to different address units in different modules, which never need this program in this world. The correct approach is: /*Module1.H*/ Extern Int a; / * Declare int A * / in the module 1. / * Module1 .c * / #include "module1.h" / * contains module 1 .h file * / INT A = 5; / * Defines int A * / in the .c file of the module 1 / * Module2 .c * / #include "module1.h" / * contains module 1 in module 1. H file * / / * module3 .c * / #include "module1.h" / * contains the module 1 .h file * / Thus, if the modules 1, 2, 3 operate A, the corresponding is the same memory unit. A embedded system typically includes two types of modules: (1) Hardware drive module, a specific hardware corresponding to a module; (2) Software function module, the division of its modules should meet the requirements of low coupling and high cohesion. Multi-mission or single task The so-called "single task system" means that the system cannot support multitasking concurrent operation, and a macro serial execution is performed. The multi-task system can "simultaneously" execute multiple tasks in macro parallel (micro possible serial). Multi-task concurrent execution usually relies on a multi-task operating system (OS), the core of multi-tasking OS is a system scheduler, which uses task control block (TCB) to manage task scheduling. TCB includes the current state, priority, event or resource to wait for the event or resource, the start address of the task code, the initial stack pointer, etc. This information is used when the scheduler is activated in the task. In addition, TCB is also used to store "context" of the task. The context of the task is all the information you want to save when the task in an execution is stopped. Typically, the context is the current state of the computer, that is, the content of each register. When a task switch occurs, the context of the currently running task is stored in the TCB, and the context of the task to be executed is removed from its TCB, and in each register. Typical examples of embedded multitasking OS have VxWorks, Uclinux, etc. Embedded OS is not a distant altrtine, we can use less than 1000 lines of code to implement a simple OS core for the 80186 processor, the author is preparing to make this job, I hope to contribute to everyone . Select multitasking or single task mode, depending on whether the system is huge. For example, most mobile programs are multitasking, but there are also some Small Songtong's protocol stacks of single tasks, no operating systems, their main program, call the handler of each software module, and simulate multitasking environments. Single task program typical architecture (1) Execute the specified address from the CPU reset; (2) Jump to the assembly code Startup execution; (3) Jump to the user's main program main execution, complete in main: A. Primary test of each hardware device; B. Initialize each software module; C. Enter the dead cycle (infinite loop), call the processing function of each module The user's main program and the processing functions of each module are completed in C. The user's main program finally entered a dead cycle, its preferred solution is: While (1) { } Some programmers write this: For (;;) { } This syntax does not have the meaning of the code, we can't see from for (;;), only understand for for (;;) means that there is unconditional cycle in the C language. Here is a few "famous" dead cycles: (1) The operating system is a dead cycle; (2) The Win32 program is a dead cycle; (3) The embedded system software is a dead cycle; (4) The thread processing function of the multi-threaded program is a dead cycle. Read more

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us