Author Topic: Starting a new project  (Read 2847 times)

Offline paulk

  • Newbie
  • *
  • Posts: 45
    • View Profile
Starting a new project
« on: May 12, 2010, 10:03:05 PM »

I've been on and off from uTasker for the last couple of months (how time flies!).  In any case, in the past, I have been using the demo application as a base point for my intended application.  It has come time to clean things up and create a new project based on my experiments.  I still think that your framework is a good starting point, but I would like some pointers as to how to proceed:

1) Should I keep the application.c, or start from scratch?
2) What is the best way to prevent the Debug messages from going to the telnet console (or serial for that matter).  I would like to use the telnet console for configuration of the device, and the debug messages get in the way (there are a lot of debug messages for Modbus communications).

I will most likely have more questions, but figure they are generic enough that other users may benefit.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3093
    • View Profile
    • uTasker
Re: Starting a new project
« Reply #1 on: May 12, 2010, 10:40:00 PM »
Hi Paul

I prefer to start with a copy of the demo project - see section 2 of for how to do this.

Then strip out all that is not needed, ensuring that the stuff left still compiles and runs correctly (I strip out in small steps as the project continues, accepting that there may be a lot of unused stuff at the beginning, which shouldn't otherwise disturb). Note that it is often useful to remove fnInitialisePorts() from application.c so that it doesn't unexpectedly configure ports when starting on a new design.

Specifically I find that application.c serves as a good basis since it handles parameters (these are often useful, even when not always planned at the start of a project). It is a place to also start other things in a central manner too.

To stop debug messages going to serial or TELNET make sure that DebugHandle is never written to a different value. Its default value is NETWORK_HANDLE, which means that all debug output passes through fnNetworkTx() - this is in debug.c and text is sent to TELNET when it is connected. Simply remove fnSendBufTCP() from this function and return 0.