Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for MCUs
  4. Code is getting reset.
Forum Updated to NodeBB v4.3 + New Features

Code is getting reset.

Scheduled Pinned Locked Moved Unsolved Qt for MCUs
4 Posts 2 Posters 119 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vishal Biradar
    wrote last edited by J.Hilk
    #1

    I have initialize CAN and read speed input from CAN and speed is showing correctly on display.
    below is main.cpp code . Is there i am doing wrong ?
    is this because of _qul_app.update(); ?

    **everything is working fine but Why my code is Getting reset.**
    some one has faced this issue please help me on this.
    int main ()
    {
        Qul::initHardware();
        Qul::initPlatform();
     
         CanIfInit();
        Qul::Application _qul_app;
        static struct ::HMI_Design_Multiscreen _qul_item;
        _qul_app.setRootItem(&_qul_item);
    R_TICK_Init(0);
    #ifdef APP_DEFAULT_UILANGUAGE
        _qul_app.settings().uiLanguage.setValue(APP_DEFAULT_UILANGUAGE);
    #endif
            static uint32_t oneMsTimer_counter =0;
        while(1){
    	 CyclicCanTask();
         speed_increment();
         
         if ((R_TICK_GetTimeMS(0) - oneMsTimer_counter ) >= 50 )
         {
             oneMsTimer_counter = R_TICK_GetTimeMS(0);
            _qul_app.update();
      }
        }
    }
    

    edit by @J.Hilk : added code tags for readability

    jsulmJ 1 Reply Last reply
    0
    • V Vishal Biradar

      I have initialize CAN and read speed input from CAN and speed is showing correctly on display.
      below is main.cpp code . Is there i am doing wrong ?
      is this because of _qul_app.update(); ?

      **everything is working fine but Why my code is Getting reset.**
      some one has faced this issue please help me on this.
      int main ()
      {
          Qul::initHardware();
          Qul::initPlatform();
       
           CanIfInit();
          Qul::Application _qul_app;
          static struct ::HMI_Design_Multiscreen _qul_item;
          _qul_app.setRootItem(&_qul_item);
      R_TICK_Init(0);
      #ifdef APP_DEFAULT_UILANGUAGE
          _qul_app.settings().uiLanguage.setValue(APP_DEFAULT_UILANGUAGE);
      #endif
              static uint32_t oneMsTimer_counter =0;
          while(1){
      	 CyclicCanTask();
           speed_increment();
           
           if ((R_TICK_GetTimeMS(0) - oneMsTimer_counter ) >= 50 )
           {
               oneMsTimer_counter = R_TICK_GetTimeMS(0);
              _qul_app.update();
        }
          }
      }
      

      edit by @J.Hilk : added code tags for readability

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote last edited by
      #2

      @Vishal-Biradar said in Code is getting reset.:

      Why my code is Getting reset

      What do you mean? What is "reset"? You also wrote that speed is shown correctly, so what is the issue?
      Please format your code properly.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Vishal Biradar
        wrote last edited by
        #3

        Thanks @jsulm for your reply
        I will give brief idea
        This code for Instrument cluster for two wheeler bike.
        I designed UI and i am trying to update speed module on designed UI .
        Value read from CAN and updating it on QML code for speed and speed is getting correcly.
        But after certain period code is resting means display is getting off again restart. it's happen continuously after certain time.
        May this information will give an idea about issue.
        Thanks!

        jsulmJ 1 Reply Last reply
        0
        • V Vishal Biradar

          Thanks @jsulm for your reply
          I will give brief idea
          This code for Instrument cluster for two wheeler bike.
          I designed UI and i am trying to update speed module on designed UI .
          Value read from CAN and updating it on QML code for speed and speed is getting correcly.
          But after certain period code is resting means display is getting off again restart. it's happen continuously after certain time.
          May this information will give an idea about issue.
          Thanks!

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote last edited by
          #4

          @Vishal-Biradar said in Code is getting reset.:

          But after certain period code is resting means display is getting off again restart

          Do you mean your app is crashing?
          The OS is restarting?
          Please say exactly what happens.

          Regarding your code: using an endless loop in an event driven application is a no-go...

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved