New Extension - Naggy

Go To Last Post
132 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Naggy is an AVR Studio 5 extension I wrote that uses Clang (LLVM frontend for C) to show compiler diagnostics as you type. It works the same way as the error squiggles you see in Visual Studio and other IDEs.

You can download it from [url=https://github.com/downloads/saa... v0.2.vsix]here[/url], and the source code up on github ( https://github.com/saaadhu/naggy ).

Pictures and more details available here (my blog) and here[/url]

Regards

Senthil

 

blog | website

Last Edited: Thu. Sep 1, 2011 - 08:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Senthil.

It looks like a very useful plugin giving back some functionality I already loved using Studio32.

I tried to install the plugin to the final Studio5 (as user with limited access, WinXP) and cannot actually see that the plugin does anything?

Has it to be activated after installation (visible in Extension manager)? Or do I need external programs?

I will test again this evening at home with admin privileges on Win7-32Bit.
I did the test and it's the same behavior.

Thanks,

Daniel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Daniel.

There is no activation needed - if it shows up as Enabled in Extension Manager, then it should be running.

If you can wait a couple of days, I'll send you a newer build that is much smaller and has (partial) support for graying out of excluded conditional preprocessor code (what you were requesting in the other thread).

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Senthil,

thanks for your reply.
I would be very pleased to do some testing on your new release.
If you have some tips where to find logs or information, I can also invest some time to find out why the current release is not working on my 2 systems. (Of course successfully installed and displayed in the extension manager.)

Daniel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is glorious. I just tried it, and while it didn't appear to work on my existing project, it works fantastically on a new project I tested it with. It may have been a combination of restarting my computer and/or the much smaller source file in the new project, however.

Well done, love it! When it's stable, email it to Atmel and see if you can get it included in the online gallery.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dean - good Idea. Projects created after Naggy installation are working.

Senthil - Naggy complains about Atmel C Coding style. (blame Atmel for that) Perhaps you can implement a switch for sloppy style. (UC3 example projects are very red)

Examples what Atmel uses in framework and Naggy marks:
- bool in C programs (ok, allowed since C99)
(bool in c++ is correctly not marked)
- uint8_t without including
- other C99 stuff

The C99 statements make it sometimes also very complicated to use the Atmel framework in C++. Such a lib should be clean portable C.

Daniel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A new version of Naggy is available at https://github.com/downloads/saa... . Naggy can now show conditionally excluded preprocessor code in a "lowlighted" way, like what Visual Studio does.

Didn't have time to put in the C99 support you'd asked for though. I've added it to the issue tracker, the next release will have that fix as well.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Update to this: the new "faded inactive preprocessor conditions" feature seems to work fantastically well. One small nitpick: it also fades out the closing "#endif" at the end of the block, which looks a little odd. If possible, could you make it only fade the code inside the inactive condition?

Really, really great job. I'd forward this to the Atmel AS5 team ASAP, since it's the missing bits from AS5 that make it even easier to use.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Glad that you found the new feature useful and thanks for the nice words. I actually am a member of the AS5 team, but I'm working on this in my spare time. Just thought I'd release a few versions to quickly get some user feedback before adding it to the online gallery.

The initial version with preprocessor lowlighting support did not handle nested conditionals correctly. I've uploaded a 0.2.1 version ( https://github.com/downloads/saa... ) which fixes that and a couple of other issues.

Can you paste the block of code with the #endif also faded out? It isn't supposed to do that. Does the problem go away if you close and reopen the file?

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Glad that you found the new feature useful and thanks for the nice words. I actually am a member of the AS5 team, but I'm working on this in my spare time. Just thought I'd release a few versions to quickly get some user feedback before adding it to the online gallery.

Whoops! Are you based in Norway? If so, I probably met you at some point during my stay.

This really is great when used with Visual Assist, so please do see if you can get it incorporated by default into the next release. If you are in Norway, go show Glen in apps - I'm sure you'll be entertained by the reaction ;).

Quote:

Can you paste the block of code with the #endif also faded out? It isn't supposed to do that. Does the problem go away if you close and reopen the file?

Funny thing, it's gone now and it behaves itself. Must have been a code-gremlin.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Senthil,

the link to 0.2.1 results in a error 404 at the moment?

With 0.2 i have again issues getting naggy to run properly in all projects. Existing projects seem to never use naggy.

Daniel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Daniel,

Sorry, my bad - I tried to upload another build with a minor bug fix, but ended up breaking the link.

The link ( https://github.com/downloads/saa... ) should work now.

Can you attach a small project on which naggy doesn't work? I've been testing this on the RTM build, and I keep running newer versions of naggy with previously created projects. I haven't seen the problem you described.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When trying to download, it gives the following message:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

    AccessDenied
    Access Denied
    59CF9D6326A3CA74
    
        calZnhprvr0qQmkeFtsCbD/Azn7svu2IkGgqc08D1/qGIsqVznNaNscYcbIWDKev
    

Felipe Maimon

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Should be fixed now.

Don't know why it got broken - Github's downloads page appears to be pretty flaky the last 2 days.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Senthil,

sorry, but I had to work on another project the last days. But as you requested I attach 2 projects ( C and C++) I have created after installing version 0.2.
None of them is working.

Then I uninstalled naggy and created a project and installed naggy again. And also missing ";" is not detected.

If necessary I can repeat the test with completely uninstalling Studio 5 or setup a clean virtual machine.
Please let me know how I can support you.

Daniel

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, that helped a lot. Looks like I messed up big time - the diagnostics part of Naggy isn't working properly with 32 bit projects (projects with a 32 bit device). When the same code is pasted in a project with an 8 bit device, Naggy works fine.

Integration with the C++ options is not yet done, so even if I fix the 32 bit bug, it'll take some more time for proper C++ support (getting include dirs, predefined symbols etc from AVR Studio).

Will let you know once I fix this (shouldn't take long). Again, thanks for taking the time to attach the projects.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I fixed the problem and upload a new build at https://github.com/downloads/saa... . Can you give it a try?

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi saaadhu,
This is fantastic and has helped to restore my faith in the new AS5.
One thing I have noted, when I run up the RTC_Example project, with Naggy enabled I get squiggly's on statements like:
static const gpio_map_t USART_GPIO_MAP =
{
{EXAMPLE_USART_RX_PIN, EXAMPLE_USART_RX_FUNCTION},
{EXAMPLE_USART_TX_PIN, EXAMPLE_USART_TX_FUNCTION}
};
and
Disable_global_interrupt();
The project compiles file with no errors or warnings.
What am I missing (a #include perhaps?)

Also did you say you are a member of the AS5 team? If so are they planning on introducing support for programming of USB DFU Boot Loaders via JTAG ICE MKII like one could in AVR32 Studio?

Your work is appreciated.

Cheers

PS I am using this on a 32 bit AVR at present in case this is a factor.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have tried this extension, it is OK, especially #if #endif, ..
but my code is:
...
#include
#include
...
ISR(INT0_vect)
- is assigned like error with label "unknown attribute 'externally_visible' ignored, unknown attribute 'signal' ignored"
...
const uint8_t PROGMEM connectedStatus3[3][103] = {...
- is assigned like error with label "unknown attribute '__progmem__' ignored"

Code was compiled without errors and warnings, and working.

Where is problem ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

LX_User wrote:

ISR(INT0_vect)
- is assigned like error with label "unknown attribute 'externally_visible' ignored, unknown attribute 'signal' ignored"
...
const uint8_t PROGMEM connectedStatus3[3][103] = {...
- is assigned like error with label "unknown attribute '__progmem__' ignored"
Where is problem ?

Naggy is internally using Clang (a frontend for LLVM, different from GCC), and it's flagging those as errors probably because it doesn't know about those attributes.

In the next build, I'll flag warnings with a different color. That won't fix the problem, but you can atleast ignore these by color. I'll also see if I can make clang ignore warnings about unknown attributes.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

aussieavr wrote:
Hi saaadhu,
This is fantastic and has helped to restore my faith in the new AS5.

Thanks. Glad you found it useful.

Quote:

static const gpio_map_t USART_GPIO_MAP =
{
{EXAMPLE_USART_RX_PIN, EXAMPLE_USART_RX_FUNCTION},
{EXAMPLE_USART_TX_PIN, EXAMPLE_USART_TX_FUNCTION}
};
and
Disable_global_interrupt();
The project compiles file with no errors or warnings.
What am I missing (a #include perhaps?)

No, you found a bug. One of the header files included before gpio.h (which has the struct's definition) had GCC and/or C99 specific extensions, and Clang stopped processing the file when it hit those errors. I tried turning on C99 and GNU specific extensions/keywords, and I don't get errors now. I'll update this thread once I upload a new build later in the day.

Quote:

Also did you say you are a member of the AS5 team? If so are they planning on introducing support for programming of USB DFU Boot Loaders via JTAG ICE MKII like one could in AVR32 Studio?

It's in our todo list is all I can say :)

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any hint of when a new version is due saaadhu :wink:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, couldn't find time to work on this. I uploaded a new build though at https://github.com/downloads/saa... .

Naggy can now show warnings (green squiggly) and errors (red squiggly) separately, and it also handles a lot more GCC specific stuff without barfing up. Unfortunately, builtin directives unknown to Clang (Enable_global_interrupt uses __builtin_csrf)x still show up as errors, but that'll have to wait for the next build.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks saaadhu, trying out now.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Senthil i think the latest ver of naggy (0.2.4) does not work in AS 5.1 Beta 148.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Could someone check it to make it sure that its a Bug?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DieCore wrote:
Could someone check it to make it sure that its a Bug?

Yes, it appears to be a bug. I don't have a proper 5.1 beta build with me at the moment, but based on the description and after some debugging with a dev build, I have a build of Naggy that I think works around the problem. Can you try installing Naggy from https://github.com/downloads/saaadhu/naggy/Naggy%20v0.2.4%20for%205.1.vsix (after uninstalling the previous version)?

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

saaadhu wrote:
DieCore wrote:
Could someone check it to make it sure that its a Bug?

Yes, it appears to be a bug. I don't have a proper 5.1 beta build with me at the moment, but based on the description and after some debugging with a dev build, I have a build of Naggy that I think works around the problem. Can you try installing Naggy from https://github.com/downloads/saaadhu/naggy/Naggy%20v0.2.4%20for%205.1.vsix (after uninstalling the previous version)?

Ok
I installed the .vsix that you provided for the AS5.1.
I tried and only the lowlighting of excluded code works.
Its saying again that error, it cant find the first header file...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, I have another build of Naggy out. I tested this on the beta build, and it appears to work fine - it works around the problem by hardcoding the default include paths for toolchains. Looks like AS 5.1 broke an API contract.

Anyway, you can try it again from the same link https://github.com/downloads/saaadhu/naggy/Naggy%20v0.2.4%20for%205.1.vsix. Do let me know if it works.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Ok, I have another build of Naggy out. I tested this on the beta build, and it appears to work fine - it works around the problem by hardcoding the default include paths for toolchains. Looks like AS 5.1 broke an API contract.

AS5.l have moved the toolchain out of the root install and into a VS extension itself - could that be the issue? Making the toolchain and ASF modules extensions would/will allow for upgrades to be made to the IDE or the modules without affecting the other components.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

saaadhu wrote:
Ok, I have another build of Naggy out. I tested this on the beta build, and it appears to work fine - it works around the problem by hardcoding the default include paths for toolchains. Looks like AS 5.1 broke an API contract.

Anyway, you can try it again from the same link https://github.com/downloads/saaadhu/naggy/Naggy%20v0.2.4%20for%205.1.vsix. Do let me know if it works.

This WORKS for the 8bit toochain ONLY in a CUSTOM simple project with #include but it can't find a path for instance (C:\Users\Administrator\Documents\AVRStudio 5.1\TC_SIMULATOR_EXAMPLE_xmega\TC_SIMULATOR_EXAMPLE_xmega\src\config\conf_example.h) (Win7 SP1 x64)
for the tc_example for xmega simulator (write simulator in the example projects menu and you find it fast)

SECONDLY it doesn't work for the avr32 toolchain at all i think,
tested with the first simulator gpio example project
it cant find the #include "gpio.h" (C:\Users\Administrator\Documents\AVRStudio 5.1\GPIO_SIMULATOR_EXAMPLE\GPIO_SIMULATOR_EXAMPLE\src\asf\avr32\drivers\gpio\gpio.h)

I also tried other example avr32 & projects with the #include as a first line in the main.c file fo the project with the same issue it cant find the path.

I think you need to hardcode the avr32 toolchain like what you did for the avr8 but also the main project path.I also noticed a strange thing, at the xmega project if i change the to "asf.h" it fixed the path unknown issue (i comment with // the previous headers to let naggy check the asf.h file first).A conversion of <> to "" doesn't help in avr32 projects.

Thanks for the Help! Its really a useful program extension specially for C dummies like me.I think its useful even for the OLD experts... :P

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the nice words, and sorry for the poor testing I did :(

I've uploaded one more build (sigh) that hopefully works - I tested it with both 8 and 32 bit example projects, and it worked fine. You can get it from the same url https://github.com/downloads/saaadhu/naggy/Naggy%20v0.2.4%20for%205.1.vsix

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

saaadhu wrote:
Thanks for the nice words, and sorry for the poor testing I did :(

I've uploaded one more build (sigh) that hopefully works - I tested it with both 8 and 32 bit example projects, and it worked fine. You can get it from the same url https://github.com/downloads/saaadhu/naggy/Naggy%20v0.2.4%20for%205.1.vsix

Hi Senthil!
Yes! Now it works fine with new projects and example projects with both toolchains AVR8 & AVR32 !!!

I have also noticed some bugs in naggy with uTasker Project with both AS5 & AS5.1 versions of AVR STUDIO and naggy [url] http://www.utasker.com/forum/ind...
[url] http://www.utasker.com/software/... [/url] like doesn't know CHAR definition and in some files (for example LCD.c,GLCD.c) has similar issue, cant find the "config.h"
You have PM :-D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is Naggy compatible with AVR Studio 6?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, there is now a build of Naggy available for 6.0. You can download it from https://github.com/downloads/saa...

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Senthil,

What's the likelyhood of this becoming a standard AS6 extension available through the online gallery, or included in the installer?

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's a very good idea Dean! I prefer to be available through the online gallery to be easier for the future updates!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Senthil

Please rebuild Naggy for the AS 6.0 Final which just released.The latest naggy for AS6 doesnt work for the AS 6.0 Final i think because the paths are changed again

Is it possible to extend naggy and make it compatible on Visual Studio 2010? I don't know if there is any gcc x86 toolchain for VS2010 as first step

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is a new build of Naggy available targeting the AS 6.0 RTM version. You can download it from https://github.com/downloads/saa...

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think there is a bug in Naggy for AS6 RTM

It works fine when i make a new C project for Atmega32 but it doesnt work for instance with this bigger project and its showing errors because it cant find/recognise the io.h header.

I also use Productinity Power Tools and Ultra Find as third party extensions and i am not sure if there are any compatibility issues.

Does anyone else has similar issues?

I tried to build myself naggy on VS2010 SP1 it opens the main solution file (Naggy.sln)but it showing an error that it can't open the naggy c# project (Naggy.csproj)

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No one? :(

Here is the example source code that i have the problem

#include 
#include 
//#include "pic_temp.h"

#define NOP() asm("nop")

#define DATA_LO_DDR  DDRA
#define DATA_LO_PORT PORTA
#define DATA_LO_PIN  PINA

#define DATA_HI_DDR  DDRD
#define DATA_HI_PORT PORTD
#define DATA_HI_PIN  PIND

#define LCD_CS_DDR  DDRB
#define LCD_CS_PORT PORTB
#define LCD_CS_PIN  PINB
#define LCD_CS_BIT  0


#define LCD_RS_DDR  DDRB
#define LCD_RS_PORT PORTB
#define LCD_RS_PIN  PINB
#define LCD_RS_BIT  1


#define LCD_WR_DDR  DDRB
#define LCD_WR_PORT PORTB
#define LCD_WR_PIN  PINB
#define LCD_WR_BIT  2


#define LCD_RD_DDR  DDRB
#define LCD_RD_PORT PORTB
#define LCD_RD_PIN  PINB
#define LCD_RD_BIT  3

#define LCD_RST_DDR  DDRB
#define LCD_RST_PORT PORTB
#define LCD_RST_PIN  PINB
#define LCD_RST_BIT  4

#define DATA_INPUT() {\
						DATA_LO_DDR = 0x00;\
						DATA_HI_DDR = 0x00;\
						}
#define DATA_OUTPUT() {\
						DATA_LO_DDR = 0xff;\
						DATA_HI_DDR = 0xff;\
						}
#define LCD_CS_H() LCD_CS_PORT |= 1<<LCD_CS_BIT
#define LCD_CS_L() LCD_CS_PORT &= ~(1<<LCD_CS_BIT)

#define LCD_RS_H() LCD_RS_PORT |= 1<<LCD_RS_BIT
#define LCD_RS_L() LCD_RS_PORT &= ~(1<<LCD_RS_BIT)

#define LCD_WR_H() LCD_WR_PORT |= 1<<LCD_WR_BIT
#define LCD_WR_L() LCD_WR_PORT &= ~(1<<LCD_WR_BIT)

#define LCD_RD_H() LCD_RD_PORT |= 1<<LCD_RD_BIT
#define LCD_RD_L() LCD_RD_PORT &= ~(1<<LCD_RD_BIT)

#define LCD_RST_H() LCD_RST_PORT |= 1<<LCD_RST_BIT
#define LCD_RST_L() LCD_RD_PORT &= ~(1<<LCD_RST_BIT)


#define PORT_INI() {\
						DATA_INPUT();\
						LCD_CS_H();\
						LCD_RS_H();\
						LCD_WR_H();\
						LCD_RD_H();\
						LCD_RST_L();\
						LCD_CS_DDR |= 1<<LCD_CS_BIT;\
						LCD_RS_DDR |= 1<<LCD_RS_BIT;\
						LCD_WR_DDR |= 1<<LCD_WR_BIT;\
						LCD_RD_DDR |= 1<<LCD_RD_BIT;\
						LCD_RST_DDR |= 1<<LCD_RST_BIT;\
						}

void LCD_WR_REG(unsigned char index,unsigned int val)
{
	LCD_CS_L();
	LCD_RS_L();
	DATA_OUTPUT();
	DATA_LO_PORT = (unsigned char)index;
	DATA_HI_PORT = 0;
	//DATA_HI_PORT = (unsigned char)(index>>8);
	LCD_WR_L();
	NOP();
	NOP();
	LCD_WR_H();
	LCD_RS_H();
	DATA_LO_PORT = (unsigned char)val;
	DATA_HI_PORT = (unsigned char)(val>>8);
	LCD_WR_L();
	NOP();
	NOP();
	LCD_WR_H();
	LCD_CS_H();
}

unsigned int LCD_RD_REG(unsigned char index)
{
	unsigned int ret;
	LCD_CS_L();
	LCD_RS_L();
	DATA_OUTPUT();
	DATA_LO_PORT = (unsigned char)index;
	DATA_HI_PORT = 0;
	//DATA_HI_PORT = (unsigned char)(index>>8);
	LCD_WR_L();
	NOP();
	NOP();
	LCD_WR_H();
	LCD_RS_H();
	DATA_INPUT();
	ret = DATA_HI_PIN;
	ret <<= 8;
	ret += DATA_LO_PIN;
	LCD_RD_L();
	NOP();
	NOP();
	LCD_RD_H();
	LCD_CS_H();
	return ret;
}

void LCD_Write_Start()
{
	LCD_CS_L();
	LCD_RS_L();
	DATA_OUTPUT();
	DATA_LO_PORT = 0x22;
	DATA_HI_PORT = 0x00;
	LCD_WR_L();
	NOP();
	NOP();
	LCD_WR_H();
	LCD_RS_H();
}

void LCD_Write_Data(unsigned int val)
{
	DATA_LO_PORT = (unsigned char)val;
	DATA_HI_PORT = (unsigned char)(val>>8);
	LCD_WR_L();
	NOP();
	NOP();
	LCD_WR_H();
}

void LCD_Write_End()
{
	LCD_CS_H();
}

void LCD_Read_Start()
{
	LCD_CS_L();
	LCD_RS_L();
	DATA_OUTPUT();
	DATA_LO_PORT = 0x22;
	DATA_HI_PORT = 0x00;
	LCD_WR_L();
	NOP();
	NOP();
	LCD_WR_H();
	LCD_RS_H();
	DATA_INPUT();
	LCD_RD_L();//dummy read
	NOP();
	LCD_RD_H();
	NOP();
	NOP();
}

unsigned int LCD_RD_DATA()
{
	unsigned int ret;
	LCD_RD_L();
	NOP();
	ret = DATA_HI_PIN;
	ret <<= 8;
	ret += DATA_LO_PIN;
	LCD_RD_H();
	NOP();
	NOP();
	return ret;	
}

void LCD_Read_End()
{
	LCD_CS_H();
}


void delay_Nms(unsigned int n)
{
	while(n--)_delay_ms(1);
}

#define Display_ON() LCD_WR_REG(0x07,0x0173)
#define Display_OFF() LCD_WR_REG(0x07,0x0000)

void LCD_Init()
{
	PORT_INI();

	LCD_RST_L();
	delay_Nms(10);
	LCD_RST_H();

	//delay 10ms
	delay_Nms(10);

	//initializing funciton 1
	LCD_WR_REG(0xe5,0x8000);
	LCD_WR_REG(0x00,0x0001);
	LCD_WR_REG(0x2b,0x0010);
	LCD_WR_REG(0x01,0x0100);
	LCD_WR_REG(0x02,0x0700);
	LCD_WR_REG(0x03,0x1230);
	LCD_WR_REG(0x04,0x0000);
	LCD_WR_REG(0x08,0x0202);
	LCD_WR_REG(0x09,0x0000);
	LCD_WR_REG(0x0a,0x0000);
	LCD_WR_REG(0x0c,0x0000);
	LCD_WR_REG(0x0d,0x0000);
	LCD_WR_REG(0x0f,0x0000);
	LCD_WR_REG(0x50,0x0000);
	LCD_WR_REG(0x51,0x00ef);
	LCD_WR_REG(0x52,0x0000);
	LCD_WR_REG(0x53,0x013f);
	LCD_WR_REG(0x60,0x2700);
	LCD_WR_REG(0x61,0x0001);
	LCD_WR_REG(0x6a,0x0000);
	LCD_WR_REG(0x80,0x0000);
	LCD_WR_REG(0x81,0x0000);
	LCD_WR_REG(0x82,0x0000);
	LCD_WR_REG(0x83,0x0000);
	LCD_WR_REG(0x84,0x0000);
	LCD_WR_REG(0x85,0x0000);
	LCD_WR_REG(0x90,0x0010);
	LCD_WR_REG(0x92,0x0000);
	LCD_WR_REG(0x93,0x0003);
	LCD_WR_REG(0x95,0x0110);
	LCD_WR_REG(0x97,0x0000);
	LCD_WR_REG(0x98,0x0000);

	//power setting function
	LCD_WR_REG(0x10,0x0000);
	LCD_WR_REG(0x11,0x0000);
	LCD_WR_REG(0x12,0x0000);
	LCD_WR_REG(0x13,0x0000);
	delay_Nms(200);
	LCD_WR_REG(0x10,0x17b0);
	LCD_WR_REG(0x11,0x0004);
	delay_Nms(50);
	LCD_WR_REG(0x12,0x013e);
	delay_Nms(50);
	LCD_WR_REG(0x13,0x1f00);
	LCD_WR_REG(0x29,0x000f);
	delay_Nms(50);
	LCD_WR_REG(0x20,0x0000);
	LCD_WR_REG(0x21,0x0000);

	//initializing function 2

	LCD_WR_REG(0x30,0x0204);
	LCD_WR_REG(0x31,0x0001);
	LCD_WR_REG(0x32,0x0000);
	LCD_WR_REG(0x35,0x0206);
	LCD_WR_REG(0x36,0x0600);
	LCD_WR_REG(0x37,0x0500);
	LCD_WR_REG(0x38,0x0505);
	LCD_WR_REG(0x39,0x0407);
	LCD_WR_REG(0x3c,0x0500);
	LCD_WR_REG(0x3d,0x0503);

	//display on
	LCD_WR_REG(0x07,0x0173);
	//Display_ON();
}


void LCD_Set_XY(unsigned int x, unsigned int y)
{
	LCD_WR_REG(0x20,x);
	LCD_WR_REG(0x21,y);
}

void LCD_Set_Window(unsigned int startX,unsigned int startY,unsigned int endX,unsigned int endY)
{
	LCD_Set_XY(startX,startY);
	LCD_WR_REG(0x50,startX);
	LCD_WR_REG(0x52,startY);
	LCD_WR_REG(0x51,endX);
	LCD_WR_REG(0x53,endY);	
}


void LCD_test()
{
	unsigned int i,j;
	LCD_Write_Start();
	for(i=0;i<320;i++)
		for(j=0;j<240;j++)
		{
			if(i>279)LCD_Write_Data(0x0000);
			else if(i>239)LCD_Write_Data(0x001f);
			else if(i>199)LCD_Write_Data(0x07e0);
			else if(i>159)LCD_Write_Data(0x07ff);
			else if(i>119)LCD_Write_Data(0xf800);
			else if(i>79)LCD_Write_Data(0xf81f);
			else if(i>39)LCD_Write_Data(0xffe0);
			else LCD_Write_Data(0xffff);
		}
	LCD_Write_End();
}

unsigned char LCD_DrawPicture(unsigned char startX, unsigned char startY, unsigned int *pic, unsigned char sizeX, unsigned char sizeY)
{
	unsigned int endX,endY;
	unsigned long totalPixels = (unsigned long)sizeX * (unsigned long)sizeY;
	endX = startX+sizeX-1;
	endY = startY+sizeY-1;
	if(endX>239 || endY>319)return 1;
	LCD_Set_Window(startX,startY,endX,endY);
	LCD_Write_Start();
	while(totalPixels--)LCD_Write_Data(pgm_read_word(pic++));
	LCD_Write_End();
	return 0;
}

unsigned char LCD_DrawPicture2(unsigned char startX, unsigned char startY, unsigned int *pic, unsigned char sizeX, unsigned char sizeY)
{
	unsigned int i,j;

	if((startX+sizeX)>240 || (startY+sizeY)>320)return 1;

	for (j = 0; j

And here is a photo of naggy errors

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oops. That looks bad. Let me take a look tonight.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
Senthil,

What's the likelyhood of this becoming a standard AS6 extension available through the online gallery, or included in the installer?

- Dean :twisted:

Dean,

I still consider it incomplete, so I'm hesitant to put it on the gallery or ship it with the installer.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just whack a beta logo on it and put it in the gallery - that way people can at least test it easily. Is there a way to mark it as compatible with all builds of Studio by default, so you don't have to keep updating the manifest with each Studio release?

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
Just whack a beta logo on it and put it in the gallery - that way people can at least test it easily. Is there a way to mark it as compatible with all builds of Studio by default, so you don't have to keep updating the manifest with each Studio release?

- Dean :twisted:

No, all extensions need to explicit set compatible versions. This is to make sure that extensions are compatible when APIs change etc.

I would like to see this on the extension gallery. A beta warning may generate enough user input to get it out of beta :P ?

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ATmega32A wasn't in the list of devices Naggy knows about, so it wasn't able to use the right device header file.

I've modified Naggy to bring it up to date with Atmel Studio 6.0 RTM in terms of supported devices. You can download the build (0.2.5) from https://github.com/saaadhu/naggy..., as usual.

To open the Naggy solution, you need to install the freely available Visual Studio SDK - that's probably why you weren't able to open it.

Sorry for the terribly late response :(

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

saaadhu wrote:
ATmega32A wasn't in the list of devices Naggy knows about, so it wasn't able to use the right device header file.

I've modified Naggy to bring it up to date with Atmel Studio 6.0 RTM in terms of supported devices. You can download the build (0.2.5) from https://github.com/saaadhu/naggy..., as usual.

To open the Naggy solution, you need to install the freely available Visual Studio SDK - that's probably why you weren't able to open it.

Sorry for the terribly late response :(

Hello!

Thanks for the information!
Its better late than never!

I installed naggy 0.2.5 but its seems its not working at all. Just before i uninstall 0.2.4 and install the 0.2.5, i downloaded from the extension manager and updated the ASF library to the latest 3.2 version so i thought that the ASF update changed something and make naggy not working at all. Well i uninstalled 0.2.5 and reinstalled the previous 0.2.4 and it works like before so something went wrong with the 0.2.5 i thing.

Well it doesnt work i mean that it never showed me the red marking line when typing errors etc exist.

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Found the problem and fixed it today. I have uploaded a new build at the same place (https://github.com/saaadhu/naggy...).

The problem was that I'd used the list of supported devices returned by the toolchain (avr-gcc) directly, without noticing that there were duplicates. This threw an error at startup and that's why nothing worked.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Senthil:
Thanks for your quick correction. I had the same problem, now it works again just fine.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Posted a new update (0.3.1) through the Atmel Gallery - you should be able to install/update via Tools->Extension Manager. This should work for both 6.0 and 6.1 beta users.

The new version shows diagnostics for the current file (and previously viewed files) in the Error List window, in addition to the squiggles in the editor. Dean, you owe me one :)

Also, specific diagnostics that Naggy emits because it doesn't know AVR/GCC specific stuff can now be turned off. I added diagnostics related to inline asm constraints, attributes and builtins to the exclusion list, but you can exclude other diags yourselves. Copy/note down the diag ID you see in the Error List, and just add it to %localappdata%\Atmel\AtmelStudio\\Extensions\Senthil Kumar Selvaraj\Naggy\\BlacklistedDiagnostics.txt. The blacklisting takes effect after you restart Atmel Studio.

As always, feel free to post bugs/suggestions, either here or at https://github.com/saaadhu/naggy...

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Senthil,

Thanks for Naggy - its a great add-on.

Quote:
The new version shows diagnostics for the current file (and previously viewed files) in the Error List window,

Oh now that's a great feature.

BTW one nice feature in AS6.1 is that as soon as you'd posted the update then the next time I started Studio it popped up to say "a new version of Naggy is available".

Pages