Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Saturnim

Member Since 09 Apr 2011
Offline Last Active Jun 16 2011 09:41 AM
-----

Posts I've Made

In Topic: 10 Mhz pulse counter

06 June 2011 - 08:05 PM

Probably you can to use internal counter of processor to measuring pulse. You should to read "Beginer Guid " ebook from GHI ,chapter 28 "Register access" . In this Chapter you have described exactly yours problem - counting high speed signals. But GHI is using other processors from NXP and example code will not work. You should to read datasheet of processor which you are using and then to write code.

In Topic: Creating Enum instances using Reflection

30 May 2011 - 07:23 PM

Thank you for yours replies. Mario Vernari, did you build this example ? I don't think because GetFileds returns empty array of FieldsInfo and this example throws exception. I dont understand this ... in Disassembly is showing clearly, that static fileds are existing in this enum type:
TypeDef #4 (02000005)
-------------------------------------------------------
	TypDefName: MyEnum  (02000005)
	Flags     : [NestedPublic] [AutoLayout] [Class] [Sealed] [AnsiClass]  (00000102)
	Extends   : 01000002 [TypeRef] System.Enum
	EnclosingClass : MFConsoleApplication1.Program (02000004)
	Field #1 (04000004)
	-------------------------------------------------------
		Field Name: value__ (04000004)
		Flags     : [Public] [SpecialName] [RTSpecialName]  (00000606)
		CallCnvntn: [FIELD]
		Field type:  I4

	Field #2 (04000005)
	-------------------------------------------------------
		Field Name: one (04000005)
		Flags     : [Public] [Static] [Literal] [HasDefault]  (00008056)
	DefltValue: (I4) 0
		CallCnvntn: [FIELD]
		Field type:  ValueClass MyEnum

	Field #3 (04000006)
	-------------------------------------------------------
		Field Name: two (04000006)
		Flags     : [Public] [Static] [Literal] [HasDefault]  (00008056)
	DefltValue: (I4) 1
		CallCnvntn: [FIELD]
		Field type:  ValueClass MyEnum

	Field #4 (04000007)
	-------------------------------------------------------
		Field Name: three (04000007)
		Flags     : [Public] [Static] [Literal] [HasDefault]  (00008056)
	DefltValue: (I4) 2
		CallCnvntn: [FIELD]
		Field type:  ValueClass MyEnum

Enum Declaration:
public enum MyEnum
        {
            one,
            two,
            three      
        }
Trying of getting fields:
Type TypeOfMyEnum = typeof(MyEnum);
FieldInfo[] enumFileds =  TypeOfMyEnum.GetFields(BindingFlags.Static | BindingFlags.Public );
Maybe I should use other BindingFlags? If I use NonPublic I have access to value__ but no to static fileds...

In Topic: Creating Enum instances using Reflection

30 May 2011 - 08:21 AM

I am trying to transport objects between full.Net and MF (Xml serialization). And I want to recreate object with has field enumertor. Other fields have constructor or are ValueTypes which I can create by Convert class from String ( I have all in xml) . Array can create by CreateInstance method.... but enum ?

In Topic: Reflection, Geting property

28 May 2011 - 12:05 PM

I am writing simple xml serialization which allows to transport object between full.net and mf. Array List was an eg. of object which has hiden data. Normaly Object has data in fields. But Arrays and ArrayLists have data which access is by indexer. I want to implement something general. Something to allows me to serialize object with indexers. But in this case I cant to cast, becouse I dont know type. Therefore I thought that using of accessor to indexer may be solution. So I asked about GetProperty. But probably the best solution will be casting on interface. Thank you for your reply and code examples.

In Topic: Time conversion between MF and Full .Net

15 May 2011 - 07:57 PM

It seems the documentation is incorrect, I have filled an issue on CodePlex.

I read the documentation... is incorrect

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.