Author Topic: Add new task to project  (Read 4157 times)

Offline Geoff

  • Newbie
  • *
  • Posts: 6
    • View Profile
Add new task to project
« on: December 05, 2017, 02:54:19 AM »
I've started working through the v1.4 User Guide, and am now looking to add a new custom task to the uTasker app. 

Section 5 states "The first thing that you will probably want to do is to add a new task of your own to the project. Therefore we will first add a new C-source file to the project with the following content.", but doesn't mention WHERE to save this file, nor what to call it.  I'm feeling kinda dumb at the moment...


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Add new task to project
« Reply #1 on: December 05, 2017, 03:02:00 AM »
Geoff

How you add a new file to the project depends on the IDE being used.
However I would just enabled QUICK_DEV_TASKS (at the beginning of config.h) and it will enable 4 empty tasks at the end of the file application.c.
The first will be started when the application task starts and you can use this task to start other tasks if you require. You can also use the task shell to add your first code:

// When QUICK_DEV_TASKS is enabled these 4 development tasks are added so that new task based developments can be easily started
// - the task configuration table and task names can later be reworked in TaskConfig.h to finalise new projects
//
extern void fnQuickTask1(TTASKTABLE *ptrTaskTable)
{
    // This task is scheduled immediately and can be used to schedule further development tasks if required (the other tasks initialise in the state UTASKER_STOP but all have software timer resources in case needed)
    //
}



Do a project search for QUICK_DEV_TASKS to see the configuration/code that they add so you know how it was done.

You can then rename the task(s) if you like and remove their content to a different file(s) as you continue.

Good luck

Regards

Mark

Offline Geoff

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Add new task to project
« Reply #2 on: December 05, 2017, 03:20:29 AM »
Thanks Mark.  I'm exploring with both the VS simulation and MCUXpresso environments.  I'll try the steps you've suggested first and go from there.